Skip to content
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

[release-1.2] 🐛 Improve to get error stack trace for machine reconcile #6746

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/controllers/machine/machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ func (r *Reconciler) drainNode(ctx context.Context, cluster *clusterv1.Cluster,
log.Error(err, "Could not find node from noderef, it may have already been deleted")
return ctrl.Result{}, nil
}
return ctrl.Result{}, errors.Errorf("unable to get node %q: %v", nodeName, err)
return ctrl.Result{}, errors.Wrapf(err, "unable to get node %v", nodeName)
}

drainer := &kubedrain.Helper{
Expand Down Expand Up @@ -560,7 +560,7 @@ func (r *Reconciler) drainNode(ctx context.Context, cluster *clusterv1.Cluster,
if err := kubedrain.RunCordonOrUncordon(drainer, node, true); err != nil {
// Machine will be re-reconciled after a cordon failure.
log.Error(err, "Cordon failed")
return ctrl.Result{}, errors.Errorf("unable to cordon node %s: %v", node.Name, err)
return ctrl.Result{}, errors.Wrapf(err, "unable to cordon node %v", node.Name)
}

if err := kubedrain.RunNodeDrain(drainer, node.Name); err != nil {
Expand Down