rancher/k3k

Prevent deleting wrong cluster when names are ambiguous

Open

#448 aperta il 29 ago 2025

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)Go (77 fork)auto 404
buggood first issueteam/collie

Metriche repository

Star
 (886 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor