-
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
object doesn't get updated after fakeClient.Delete(object) #3059
Comments
I assume the regular client updates it? (I think I remember that the regular client also doesn't update it, but I'm not sure) |
Actually it looks like it doesn't:
So after someone deletes an object, their in-mem representation doesn't reflect that? That is different from all other methods and very confusing |
Yeah. I think I noticed this 1-2 months ago in a unit test. First I thought the fake client is the problem but then I saw that the real client has the same behavior :) |
I can take this one if you all don't mind. /assign @troy0820 |
I'm wondering if there are comparable cases in client-go and how they are handled there |
fakeClient.Delete(obj) doesn't update deletionTimestamp of the obj passed to the function. The bug is in fakeClient.deleteObject, since it gets a new object and updates the new object without rewriting the original object.
Reference: https://github.com/kubernetes-sigs/controller-runtime/blob/v0.19.0/pkg/client/fake/client.go#L1085-L1095
The text was updated successfully, but these errors were encountered: