-
Notifications
You must be signed in to change notification settings - Fork 200
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
handle conflict error in instrumentation config updates #1737
Conversation
@@ -55,19 +56,18 @@ func (r *InstrumentedApplicationReconciler) Reconcile(ctx context.Context, req c | |||
|
|||
instrumentationRules := &odigosv1.InstrumentationRuleList{} | |||
err = r.Client.List(ctx, instrumentationRules) | |||
if client.IgnoreNotFound(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.
can a list operation return not found? or is it only for safety?
If it's not found, don't we want to return and not cause any updates?
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.
Thich check is for errors which are not NotFound
A typical error we see when trying to update the instrumentation config CR is:
This is due to the Get and Update pattern we use. Following #1710 , use the update error util for this case as well.
Adding to the error handling util - a check for
IsNotFound
error and ignoring it.