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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Reset resource version if fake client Create call failed #919
Conversation
Welcome @muvaf! |
Hi @muvaf. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
As I understand the scenario being described:
Assuming that this change addresses this scenario, what happens if you started the client with an object, made a series of My personal feeling is that there is not a guarantee to be made in the case that you call |
Each
Actually, the problem is not about |
Thank you for the explanation.
Looking at the current implementation of
I am a little lost here, my apologies, but this PR is modifying the object when |
No problem!
Here
If you look at a few lines before the actual |
Now I got it. Thanks. /lgtm |
/ok-to-test |
It seems to be a flake. /retest |
@shawn-hurley thanks for the test! Seems like this is ready to merge. |
@muvaf One more thing. I think it would be appropriate for you to add a test to |
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
@djzager @shawn-hurley Added a test that verifies the submitted object is not changed after a failed |
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
/assign @vincepri
Thanks for the fix @muvaf |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: muvaf, shawn-hurley 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 |
/retest |
Fixes #918
This breaks the code that relies on first checking if an object already exists via the error returned from
Create
and then runPatch
. SincePatch
call of fake client does anUpdate
operation, which checks resource version match, it returnsobject was changed
error in these cases because the local object now has resource version 1 but what storage has is resource version 0 since the client was initialized with that object.