-
Notifications
You must be signed in to change notification settings - Fork 462
daemon: Clearly log if error is from draining #408
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -82,25 +82,28 @@ func (dn *Daemon) updateOSAndReboot(newConfig *mcfgv1.MachineConfig) error { | |
|
|
||
| dn.recorder.Eventf(node, corev1.EventTypeNormal, "Drain", "Draining node to update config.") | ||
|
|
||
| err = wait.ExponentialBackoff(wait.Backoff{ | ||
| backoff := wait.Backoff{ | ||
| Steps: 5, | ||
| Duration: 10 * time.Second, | ||
| Factor: 2, | ||
| }, func() (bool, error) { | ||
| } | ||
| var lastErr error | ||
| wait.ExponentialBackoff(backoff, func() (bool, error) { | ||
| err := drain.Drain(dn.kubeClient, []*corev1.Node{node}, &drain.DrainOptions{ | ||
| DeleteLocalData: true, | ||
| Force: true, | ||
| GracePeriodSeconds: 600, | ||
| IgnoreDaemonsets: true, | ||
| }) | ||
| if err != nil { | ||
| glog.Infof("Draining failed with: %v; retrying...", err) | ||
| lastErr = err | ||
| return false, nil | ||
| } | ||
| lastErr = nil | ||
| return true, nil | ||
| }) | ||
| if err != nil { | ||
| return err | ||
| if lastErr != nil { | ||
| return errors.Wrapf(lastErr, "Failed to drain node (%s tries)", backoff.Steps) | ||
| } | ||
|
Member
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. we're gonna miss the I was thinking something like https://github.com/openshift/machine-config-operator/blob/master/pkg/operator/sync.go#L357-L362
Member
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. this is not blocking of course, we control the ConditionFunc here today but if someone jumps and add a |
||
| glog.V(2).Info("Node successfully drained") | ||
| } | ||
|
|
||
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.
Why not keep the logging here to show some progress if we're retrying?
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.
Follow up for this in #412!