Skip to content

Commit 8b2b353

Browse files
authored
fix(vmop): prevent Maintenance mode from getting stuck during restore (#2144)
* fix(vmop): prevent Maintenance mode from getting stuck during restore Return reconcile.Result instead of nil to properly complete the reconciliation loop when snapshot steps exit early (exit maintenance step, waiting disk ready step). Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> * fix(vmop): set maintenance condition to false instead of early return Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> --------- Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
1 parent d0a067b commit 8b2b353

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

images/virtualization-artifact/pkg/controller/vmop/snapshot/internal/step/exit_maintenance_step.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ func (s ExitMaintenanceStep) Take(ctx context.Context, vmop *v1alpha2.VirtualMac
9292
)
9393
return &reconcile.Result{}, err
9494
}
95+
96+
maintenanceVMCondition.Status = metav1.ConditionFalse
9597
}
9698

9799
// If the maintenance condition was not present on the VM,

images/virtualization-artifact/pkg/controller/vmop/snapshot/internal/step/waiting_disk_ready_step.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (s WaitingDisksReadyStep) Take(ctx context.Context, vmop *v1alpha2.VirtualM
7979
if k8serrors.IsNotFound(err) {
8080
cb.Message("Waiting for resource readiness.")
8181
conditions.SetCondition(cb, &vmop.Status.Conditions)
82-
return nil, nil
82+
return &reconcile.Result{}, nil
8383
}
8484
return &reconcile.Result{}, fmt.Errorf("failed to get the `VirtualDisk`: %w", err)
8585
}

0 commit comments

Comments
 (0)