Skip to content
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

Delete with empty name results in deletecollection #2291

Open
jpbetz opened this issue Oct 7, 2024 · 2 comments
Open

Delete with empty name results in deletecollection #2291

jpbetz opened this issue Oct 7, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jpbetz
Copy link

jpbetz commented Oct 7, 2024

What happened (please include outputs or screenshots):

According to kubernetes/kubernetes#127746, if delete is called with an empty name, the client will not fail but instead call delete on the collection resource and delete the entire collection of resources.

What you expected to happen:

Delete either performs the delete of a single resource, or fails.

How to reproduce it (as minimally and precisely as possible):

Call delete, but provide an empty name.

cc @zhifei92

@jpbetz jpbetz added the kind/bug Categorizes issue or PR as related to a bug. label Oct 7, 2024
@roycaihw
Copy link
Member

roycaihw commented Oct 9, 2024

The delete method compose the request to something like api/v1/namespaces/{namespace}/pods/{name} and when name is empty, it becomes api/v1/namespaces/{namespace}/pods, which by Kubernetes definition will delete all resources in the namespace / cluster.

This was also reported in #2209

I think at this point it will be hard to change this behavior, because we don't know how many users may already depend on this behavior.

@jpbetz
Copy link
Author

jpbetz commented Oct 10, 2024

What would the client code from python look like to make this call? Is there already a separate deletecollection call?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants