-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Draft: Test that an object is updatable after updating its status. #2486
Draft: Test that an object is updatable after updating its status. #2486
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: berlin-ab The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @berlin-ab. 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. |
/hold This is just a proof of concept test and possible implementation. Please rework as you see fit. |
expectedObj.Annotations = map[string]string{ | ||
"some-annotation-key": "some", | ||
} | ||
Expect(cl.Update(context.Background(), obj)).NotTo(HaveOccurred()) |
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 test fails. The test below was double checking that the reverse order also works.
…r doing the deep copy
@@ -436,6 +437,14 @@ func (t versionedTracker) update(gvr schema.GroupVersionResource, obj runtime.Ob | |||
intResourceVersion++ | |||
accessor.SetResourceVersion(strconv.FormatUint(intResourceVersion, 10)) | |||
|
|||
// obtain the current obj accessor's pointer, |
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.
I was looking for a cleaner way to do this, so maybe you can think of one. I don't like the distance between when we make the deep copy and when we need to handle the repercussions of doing so.
I've pulled in the latest fixes for the fake client to test against my personal project. That how I ran against this current bug. After applying the fix in this PR, my local tests work as expected. This PR is a proof of concept test and fix. Please rework it as you need to in order to incorporate it into the project. |
PR needs rebase. 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. |
Test fails at: