-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add call to return if machine exists and consider requeue-after error… #546
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why return err here? can this ever not-be nil? seems like we return on line 158 if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can be not nil: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I am wrong - but doesn't line 175 shadow the err value, so you will never get that assignment:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh yeh, I think you are right! thanks! I'll change it |
||
} | ||
|
||
func (c *ReconcileMachine) create(machine *clusterv1.Machine) error { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to return this, we should not shadow it
if err = r.create(m)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, we may not want to shadow the update either