rancher/k3k

Prevent deleting wrong cluster when names are ambiguous

Open

#448 opened on Aug 29, 2025

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Go (77 forks)auto 404
buggood first issueteam/collie

Repository metrics

Stars
 (886 stars)
PR merge metrics
 (PR metrics pending)

Description

When two or more clusters share the same name but exist in different namespaces, running k3kcli cluster delete <cluster-name> without the --namespace flag can easily delete the wrong cluster.

The command currently defaults to the k3k-<cluster-name> namespace if one exists, which may not be the user's intention. This can lead to accidental data loss.

-> % k3kcli cluster list      
NAMESPACE   NAME                  MODE     STATUS    POLICY
default     foo                   shared   Unknown   <none>
k3k-foo     foo                   shared   Unknown   <none>

Expected Behavior

The CLI should detect the name collision and fail with an error message, requiring the user to specify the target with the --namespace flag to prevent accidental deletion.

Contributor guide