[Fix] Removing non-existing cluster via configuration #886
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
With k3d I can delete a cluster before it is created. Such a use case is very useful in case I want to restart my test environment.
reset: k3d cluster delete mycluster k3d cluster create mycluster <installing things....>
Even better is to use a configuration with the argument
-c config.yaml
. The k3d can delete acluster based on configuration, but it cannot handle the case that the cluster does not exist.
This PR allows that if I use the configuration and delete a non-existing cluster, k3d will not end up fatal.
Why
It is important for me that the cluster name is used in one single place - ideally the configuration.
Thanks to this PR I can do the following:
reset: k3d cluster delete -c cluster/local.yaml k3d cluster create -c cluster/local.yaml
Implications
The change concerns one scenario - deleting a non-existing cluster if the cluster name is in the configuration.
Signed-off-by: kuritka [email protected]