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 · 3 comments
Open

Delete with empty name results in deletecollection #2291

jpbetz opened this issue Oct 7, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

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?

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 8, 2025
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. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants