-
Notifications
You must be signed in to change notification settings - Fork 32
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
Minimize number of unnecessary logs #298
Conversation
@@ -476,8 +479,16 @@ func (r *LeaderWorkerSetReconciler) updateStatus(ctx context.Context, lws *leade | |||
if err != nil { | |||
return false, err | |||
} | |||
// Get the most up to date lws object to merge the status with |
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.
This is forcing an update, I think this is dangerous to do.
A better option is to check if the error is a conflict, in which case we requeue the key and return without printing an error, we should do that here:
if err != nil { |
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.
So switch it back to status().Update()
?
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.
yes, and return ctrl.Result{Requeue: true}, nil
when the error is a conflict
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.
Makes sense. Will also change it so that it doesn't log the error if there is a conflict
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, Edwinhr716 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
What this PR does / why we need it
Minimize the number of unnecessary logs that get emitted
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?