-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Client: Add DeleteCollection #344
Comments
there's a WIP PR for this (#324 ) |
I have been working on this and Could use a bit of feedback. How did you invision using this call? I have tried two different forms, one where there is an explicit DeleteCollection() added to the client interface, and one where the presence of CollectionOptions in the Delete() call does the same logic. The one thing that I fear, which might be unneeded, is that in both cases I only use obj's type to determine what to delete. This means that if you pass an object and a CollectionOptions that won't match the object it won't delete that object. For example:
This will delete any Pod in the |
Sorry for the late feedback, I was on vacation.
I personally would prefer
What is the reason to even have both an |
The reasoning behind having a different object and collectionOptions, or ListOptions, is that every delete api in kubernetes is tied to a GVK. The obj gives us the kind of things we are deleting, the DeleteOptions carry things like if the deletes should propagate, and the CollectionOptions are your label selectors. Just to explore this a bit further, and this is just me thinking out loud, we could remove the obj from the DeleteCollection's signature, and add something like I don't think there is an easy, and safe, way to get the GVK of a runtime.Object, but How would something like |
we have machinery inside CR to do |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
This was implemented in #447 |
It would be awesome if
client.Writer
was extended withDeleteCollection
to allow deleting a set of objects with one call./kind feature
The text was updated successfully, but these errors were encountered: