Skip to content

Commit

Permalink
Always bind WFFC for data volumes
Browse files Browse the repository at this point in the history
When importing and using DVs, always set the annotation to bind WFFC.
This commit removes the consumer pod for vsphere flows as we can use the
annotation for it.

Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed Mar 19, 2024
1 parent 227da5a commit 6be340d
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions pkg/controller/plan/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ func (r *KubeVirt) EnsureDataVolumes(vm *plan.VMStatus, dataVolumes []cdi.DataVo
return
}

var pvcNames []string
for _, dv := range dataVolumes {
if !r.isDataVolumeExistsInList(&dv, dataVolumeList) {
err = r.Destination.Client.Create(context.TODO(), &dv)
Expand All @@ -490,21 +489,7 @@ func (r *KubeVirt) EnsureDataVolumes(vm *plan.VMStatus, dataVolumes []cdi.DataVo
"vm",
vm.String())
}
// DataVolume and PVC names are the same
pvcNames = append(pvcNames, dv.Name)
}
el9, el9Err := r.Context.Plan.VSphereUsesEl9VirtV2v()
if el9Err != nil {
err = el9Err
return
}
if el9 {
err = r.createPodToBindPVCs(vm, pvcNames)
if err != nil {
return err
}
}

return
}

Expand Down Expand Up @@ -920,9 +905,8 @@ func (r *KubeVirt) dataVolumes(vm *plan.VMStatus, secret *core.Secret, configMap
annotations[AnnDefaultNetwork] = path.Join(
r.Plan.Spec.TransferNetwork.Namespace, r.Plan.Spec.TransferNetwork.Name)
}
if r.Plan.Spec.Warm || !r.Destination.Provider.IsHost() || r.Plan.IsSourceProviderOCP() {
annotations[AnnBindImmediate] = "true"
}
// Set annotation for WFFC storage classes
annotations[AnnBindImmediate] = "true"
// Do not delete the DV when the import completes as we check the DV to get the current
// disk transfer status.
annotations[AnnDeleteAfterCompletion] = "false"
Expand Down

0 comments on commit 6be340d

Please sign in to comment.