fix(cluster): run Delete when no clusters are tracked#3969
Open
lkingland wants to merge 1 commit into
Open
Conversation
func cluster delete used to hard-error with "no clusters exist" when the tracked kubeconfig list was empty, never calling cluster.Delete. Hand off to Delete instead so empty-system cleanup is idempotent (exit 0), including shared resources Delete already tears down when List() is empty. Also quiet kind-delete warnings when no kubeconfig was present — otherwise every empty-system delete prints a scary failure for a cluster that never existed. Contract: empty list → exit 0 (was non-zero). Wrong name with existing clusters still errors. Functions#63 (recovered from local moxzqowr)
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lkingland The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Member
Author
|
/retest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
func cluster deleteno longer hard-errors withno clusters existwhen nothing is tracked. It hands off tocluster.Delete, which already performs empty-list shared-resource cleanup and returns nil (idempotent /rm -fsemantics — exit 0 where it previously exited non-zero).kind deletewarnings when no kubeconfig is present, so empty-system delete does not print a scary "failed to delete cluster" for a cluster that never existed.Wrong name with existing clusters still errors as before.
/kind bug
Release Note
Docs
Functions#63