-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Use patch instead of update to replace sidecars with nop image #9128
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
Use patch instead of update to replace sidecars with nop image #9128
Conversation
|
|
934d222 to
434ad9a
Compare
|
/retest |
|
@prad9192 you will need to rebase against main branch. The e2e failure are fixed in the latest main commits. |
|
/label kind/bug |
|
@prad9192: The label(s) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/retest |
|
/kind bug |
afrittoli
left a comment
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.
Thanks for this fix, it's much appreciated!
Could you add some testing for the new functionality? It should be possible to simulate the situation you described in the PR description of the pod being updated.
Thank you for the feedback, as requested the tests are added, kindly review. |
0aca735 to
0877c4c
Compare
afrittoli
left a comment
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.
Thanks a lot for the update, lgtm!
One last ask before it's approved - we don't use merge commits in Tekton, could you please squash your PR to a single commit? Thank you!
d0cc83b to
cdf36c5
Compare
Done, could you please review, when you get a chance? |
|
/approve |
9b63960 to
ea7d2ca
Compare
vdemeester
left a comment
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.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
1 similar comment
|
/retest |
What
Changed StopSidecars() to use Patch() instead of Update() when stopping sidecar containers by replacing their images with the nop image.
Why
The original implementation used Update(), which requires an exact resourceVersion match. This causes 409 conflicts when the kubelet updates the pod status between our GET and UPDATE calls (which happens frequently as containers terminate).
This causes the below errors on the pod.
And the task runs fail with TaskRunResolutionFailed
Even though the task succeeded and sidecars eventually stop, the TaskRun gets marked as failed due to this race condition.
The fix uses JSON Patch (same pattern as UpdateReady() and CancelPod() in this file), which only patches the specific container image fields
Release Notes
Does this PR introduce a user-facing change?