Skip to content

fix(cluster): run Delete when no clusters are tracked#3969

Open
lkingland wants to merge 1 commit into
knative:mainfrom
lkingland:coder.functions.2/63
Open

fix(cluster): run Delete when no clusters are tracked#3969
lkingland wants to merge 1 commit into
knative:mainfrom
lkingland:coder.functions.2/63

Conversation

@lkingland

Copy link
Copy Markdown
Member

Changes

  • 🐛 func cluster delete no longer hard-errors with no clusters exist when nothing is tracked. It hands off to cluster.Delete, which already performs empty-list shared-resource cleanup and returns nil (idempotent / rm -f semantics — exit 0 where it previously exited non-zero).
  • 🧹 Quiet kind delete warnings 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

func cluster delete is idempotent when no clusters are tracked (exit 0, shared cleanup)

Docs

  • Docs PR required (link below)
  • Docs not required

Functions#63

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)
@knative-prow knative-prow Bot added the kind/bug Bugs label Jul 25, 2026
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos July 25, 2026 15:38
@knative-prow

knative-prow Bot commented Jul 25, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added approved 🤖 PR has been approved by an approver from all required OWNERS files. size/M 🤖 PR changes 30-99 lines, ignoring generated files. labels Jul 25, 2026
@lkingland

Copy link
Copy Markdown
Member Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. kind/bug Bugs size/M 🤖 PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant