Skip to content

Commit 2cdd008

Browse files
committed
vspherevm: ensure to requeueAfter on task failed
1 parent b4cb167 commit 2cdd008

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

controllers/vspherevm_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ func (r vmReconciler) reconcileNormal(ctx context.Context, vmCtx *capvcontext.VM
437437
// Do not proceed until the backend VM is marked ready.
438438
if vm.State != infrav1.VirtualMachineStateReady {
439439
log.Info(fmt.Sprintf("VM state is %q, waiting for %q", vm.State, infrav1.VirtualMachineStateReady))
440+
if !vmCtx.VSphereVM.Status.RetryAfter.IsZero() {
441+
return reconcile.Result{RequeueAfter: time.Until(vmCtx.VSphereVM.Status.RetryAfter.Time)}, nil
442+
}
440443
return reconcile.Result{}, nil
441444
}
442445

0 commit comments

Comments
 (0)