Skip to content

Commit b6045f5

Browse files
timoreimannprksu
authored andcommitted
Do not mark droplet create failures as terminal (kubernetes-sigs#215)
This allows to address transient errors through automatic reconciles.
1 parent 1d6aa19 commit b6045f5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

controllers/domachine_controller.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,10 @@ func (r *DOMachineReconciler) reconcile(ctx context.Context, machineScope *scope
225225
if droplet == nil {
226226
droplet, err = computesvc.CreateDroplet(machineScope)
227227
if err != nil {
228-
errs := errors.Errorf("Failed to create droplet instance for DOMachine %s/%s: %v", domachine.Namespace, domachine.Name, err)
229-
machineScope.SetFailureReason(capierrors.CreateMachineError)
230-
machineScope.SetFailureMessage(errs)
231-
r.Recorder.Event(domachine, corev1.EventTypeWarning, "InstanceCreatingError", errs.Error())
232-
return reconcile.Result{}, errs
228+
err = errors.Errorf("Failed to create droplet instance for DOMachine %s/%s: %v", domachine.Namespace, domachine.Name, err)
229+
r.Recorder.Event(domachine, corev1.EventTypeWarning, "InstanceCreatingError", err.Error())
230+
machineScope.SetInstanceStatus(infrav1.DOResourceStatusErrored)
231+
return reconcile.Result{}, err
233232
}
234233
r.Recorder.Eventf(domachine, corev1.EventTypeNormal, "InstanceCreated", "Created new droplet instance - %s", droplet.Name)
235234
}

0 commit comments

Comments
 (0)