Skip to content

Commit 175fa10

Browse files
committed
fix rerun the completed vmiMigration
Signed-off-by: clyi <clyi@alauda.io>
1 parent 1b04dbd commit 175fa10

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/controller/kubevirt.go

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ func (c *Controller) handleAddOrUpdateVMIMigration(key string) error {
6565
return nil
6666
}
6767

68+
if vmiMigration.Status.MigrationState.Completed {
69+
klog.Infof("VirtualMachineInstanceMigration %s migration state is completed, skipping", key)
70+
return nil
71+
}
72+
6873
vmi, err := c.config.KubevirtClient.VirtualMachineInstance(namespace).Get(context.TODO(), vmiMigration.Spec.VMIName, metav1.GetOptions{})
6974
if err != nil {
7075
utilruntime.HandleError(fmt.Errorf("failed to get VMI by name %s: %w", vmiMigration.Spec.VMIName, err))

0 commit comments

Comments
 (0)