kubernetes-sigs / kind

Kubernetes IN Docker - local clusters for testing Kubernetes
https://kind.sigs.k8s.io/
Apache License 2.0
13.35k stars 1.55k forks source link

Kind does not validate if cluster exists before delete it #3639

Closed reysonbarros closed 4 months ago

reysonbarros commented 4 months ago

What happened:

If deleting a non-existent cluster, kind shows up a message saying that the cluster was deleted.

What you expected to happen: Kind should thrown a message saying that the cluster does not exist

How to reproduce it (as minimally and precisely as possible): kind create cluster --name test kind delete cluster --name test1 Deleting cluster "test1" ... kind delete clusters test1 Deleted clusters: ["test1"] Anything else we need to know?: No Environment:

stmcginnis commented 4 months ago

This is working as designed. The delete call is idempotent, so you should be able to call it many times without it failing.

This of it more as saying "I don't want cluster X to exist" and kind making sure that it does not. If it didn't exist in the first place, there's just less work that kind needs to do to match the requested state.

/close

k8s-ci-robot commented 4 months ago

@stmcginnis: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/kind/issues/3639#issuecomment-2143671030): >This is working as designed. The delete call is idempotent, so you should be able to call it many times without it failing. > >This of it more as saying "I don't want cluster X to exist" and kind making sure that it does not. If it didn't exist in the first place, there's just less work that kind needs to do to match the requested state. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
BenTheElder commented 4 months ago

(think of this like rm -f, changing it now would be a breaking change to a lot of best-practices scripts that ensure cleanup on exit, versus we already log the actual actions taken so interactive users can tell if anything was done or not)