Skip to content

Commit

Permalink
Set transfer network on the conversion pod
Browse files Browse the repository at this point in the history
Before version 2.4, the virt-v2v conversion pod operated on a local disk
after the disk was retrieved by CDI. CDI considered the transfer network
when transfering the data from vSphere.

As from version 2.4, when running a cold-migration to the local cluster,
virt-v2v is also responsible to connect to vSphere and retrieve the
disk(s) from there, therefore it now needs to consider the transfer
network that is selected as well.

This patch adds the transfer network, if set, on the conversion pod in
both cases.

Signed-off-by: Arik Hadas <[email protected]>
  • Loading branch information
ahadas committed Dec 6, 2023
1 parent f22a649 commit 6e4a11a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/controller/plan/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1311,10 +1311,17 @@ func (r *KubeVirt) guestConversionPod(vm *plan.VMStatus, vmVolumes []cnv.Volume,
if err != nil {
return
}
// pod annotations
annotations := map[string]string{}
if r.Plan.Spec.TransferNetwork != nil {
annotations[AnnDefaultNetwork] = path.Join(
r.Plan.Spec.TransferNetwork.Namespace, r.Plan.Spec.TransferNetwork.Name)
}
// pod
pod = &core.Pod{
ObjectMeta: meta.ObjectMeta{
Namespace: r.Plan.Spec.TargetNamespace,
Annotations: annotations,
Labels: r.conversionLabels(vm.Ref, false),
GenerateName: r.getGeneratedName(vm),
},
Expand Down

0 comments on commit 6e4a11a

Please sign in to comment.