Skip to content

Representing soft deletes in the tests #1

Answered by scothis
squeedee asked this question in Q&A
Discussion options

You must be logged in to vote

I'd like the ResourceManager's Delete to receive the correct response from the fakeClient AND for the resources to remain in the FakeClient stubs, with deletionTimestamps added.

Looking at the fake client code in controller-runtime, it appears this is mostly already happening. The gotcha is that the passed in object isn't updated to reflect the server side value. It will need to be fetched again to see the deletion timestamp. The real client appears to behave the same way. You may see different behavior in a running controller if the resource is managed by an informer. In that case you'll need to use the APIReader to talk directly to the API server instead of the Client.

https://github.…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@squeedee
Comment options

@squeedee
Comment options

@scothis
Comment options

@squeedee
Comment options

@scothis
Comment options

Answer selected by squeedee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants