Skip to content

Commit 83dc984

Browse files
committed
Remove selected node annotation from PVC/DV so the
newly created blank one does not get it. If left it will bind the PV to the same node as the original and the migration will fail. Signed-off-by: Alexander Wels <awels@redhat.com>
1 parent 5045d1b commit 83dc984

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

pkg/controller/directvolumemigration/pvcs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (t *Task) createDestinationDV(srcClient, destClient compat.Client, pvc miga
7474

7575
// Remove any cdi related annotations from the PVC
7676
for k := range destPVC.Annotations {
77-
if strings.HasPrefix(k, "cdi.kubevirt.io") {
77+
if strings.HasPrefix(k, "cdi.kubevirt.io") || strings.HasPrefix(k, "volume.kubernetes.io/selected-node") {
7878
delete(destPVC.Annotations, k)
7979
}
8080
}

pkg/controller/directvolumemigration/vm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ func createBlankDataVolumeFromPVC(client k8sclient.Client, targetPvc *corev1.Per
531531
}
532532
return err
533533
}
534+
534535
return nil
535536
}
536537

0 commit comments

Comments
 (0)