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
#546)

* add call to return if machine exists and consider requeue-after error on create

* return nil/err explicitly
  • Loading branch information
enxebre authored and k8s-ci-robot committed Oct 19, 2018
1 parent 0a0313c commit 2d88aef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/machine/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,18 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul
glog.Infof("Actuator returned requeue-after error: %v", requeueErr)
return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.RequeueAfter}, nil
}
return reconcile.Result{}, err
}
return reconcile.Result{}, nil
}
// 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)
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{}, err
}
return reconcile.Result{}, nil
Expand Down

0 comments on commit 2d88aef

Please sign in to comment.