Skip to content

Commit

Permalink
fix: log actual error message in the reconcile error
Browse files Browse the repository at this point in the history
Looks like the logger extracts only stacktrace from the error passed as
the first argument.
Additionally log error as the separate field.

Signed-off-by: Artem Chernyshev <[email protected]>
  • Loading branch information
Unix4ever committed May 11, 2023
1 parent c0cb020 commit d2f21be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/taloscontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ func (r *TalosControlPlaneReconciler) reconcile(ctx context.Context, cluster *cl
}

if result.RequeueAfter != 0 {
r.Log.Error(err, "reconcile failed", "requeue after", result.RequeueAfter.String())
if err != nil {
r.Log.Error(err, "reconcile failed", "requeue after", result.RequeueAfter.String(), "error", err.Error())
}

return result, nil
}
Expand Down

0 comments on commit d2f21be

Please sign in to comment.