-
Notifications
You must be signed in to change notification settings - Fork 562
Return copy of annotations in grpcCatalogSourceDecorator #2813
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
Return copy of annotations in grpcCatalogSourceDecorator #2813
Conversation
8822702
to
f580018
Compare
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.
Alternatively, we could generate the list of annotations once when creating the grpcCatalogSourceDecorator, but I don't think this will introduce a huge performance impact.
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.
+1 on Alex's suggestion as well. Looking through the rest of these methods, it looks like we wouldn't have the same issue as labels. Do we need a test here?
Feel free to remove the hold. /lgtm |
I was trying to think how to add one, but wasn't sure the best way to test it. I'm also wondering if we should move the logic to the reconciler. |
I think this is a small enough change that I'm comfortable merging as is. |
Yep, same here, and it's definitely helpful that you linked to the BZ so we're tracking some historical context over time. |
f580018
to
191b2dd
Compare
191b2dd
to
6823170
Compare
Signed-off-by: perdasilva <[email protected]>
6823170
to
e0cd528
Compare
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.
Found one spelling mistake, otherwise looks good.
Fixed!! good eyes =D |
/lgtm |
Co-authored-by: Alexander Greene <[email protected]> Signed-off-by: perdasilva <[email protected]>
ab09aae
to
a40d0b4
Compare
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.
Another option is to add a comment stating that the reconcile.Pod function
will mutate the labels/annotations provided and updating all calls to provide copies, but making the function copy the arrays is probably safer for future developers that might rely on this method.
/lgtm
/hold cancel |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: awgreene, perdasilva, timflannagan 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 |
Signed-off-by: perdasilva [email protected]
Description of the change:
Recent changes adding the grpcCatalogSourceDecorator introduced a concurrent write issue on the annotations. This PR updates the Annotations method to return a copy of the annotations to avoid this issue.
Motivation for the change:
https://bugzilla.redhat.com/show_bug.cgi?id=2101357
Architectural changes:
None
Testing remarks:
Deployed on kind and not seeing the issue
Reviewer Checklist
/doc
[FLAKE]
are truly flaky and have an issue