Skip to content

Commit

Permalink
add call to return if machine exists and consider requeue-after error…
Browse files Browse the repository at this point in the history
… on create
  • Loading branch information
enxebre committed Oct 16, 2018
1 parent 19551f1 commit 0418bf9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/controller/machine/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,18 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul
return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.RequeueAfter}, nil
}
}
return reconcile.Result{}, err
}
// Machine resource created. Machine does not yet exist.
glog.Infof("Reconciling machine object %v triggers idempotent create.", m.ObjectMeta.Name)
if err := r.create(m); err != nil {
glog.Warningf("unable to create machine %v: %v", name, err)
return reconcile.Result{}, err
if requeueErr, ok := err.(*controllerError.RequeueAfterError); ok {
glog.Infof("Actuator returned requeue-after error: %v", requeueErr)
return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.RequeueAfter}, nil
}
}
return reconcile.Result{}, nil
return reconcile.Result{}, err
}

func (c *ReconcileMachine) create(machine *clusterv1.Machine) error {
Expand Down

0 comments on commit 0418bf9

Please sign in to comment.