Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: Use cluster name with argocd cluster rm #8814

Closed
danielhelfand opened this issue Mar 17, 2022 · 0 comments · Fixed by #8823
Closed

cli: Use cluster name with argocd cluster rm #8814

danielhelfand opened this issue Mar 17, 2022 · 0 comments · Fixed by #8823
Labels
enhancement New feature or request

Comments

@danielhelfand
Copy link
Contributor

danielhelfand commented Mar 17, 2022

Summary

I have the following cluster credentials added:

argocd cluster list

SERVER                          NAME             VERSION  STATUS   MESSAGE                                              PROJECT
https://127.0.0.1:6443          rancher-desktop           Unknown  Cluster has no application and not being monitored.  
https://kubernetes.default.svc  in-cluster                Unknown  Cluster has no application and not being monitored.  

When I run the command below and attempt to delete the cluster by its NAME instead of SERVER, I get the following error

argocd cluster rm rancher-desktop 
FATA[0001] rpc error: code = PermissionDenied desc = permission denied

The error is confusing and doesn't mention you can only delete by cluster server (e.g. argocd cluster rm https://127.0.0.1:6443).

Motivation

Referring to a cluster by its name is common for other cli commands (e.g. cluster get). It would be helpful to be able to remove the cluster using its name as the argument to the command.

Proposal

Allow argocd cluster rm to remove cluster credentials by cluster name.

How do you think this should be implemented?

The cluster command has already has a helper function for deciding whether to create a cluster query based on server or name argument being passed. Instead of only accepting server arguments like the cluster rm command does now, it could be switched to use the helper function that returns a cluster query with a server or name. The last part of this would be tweaking the server to make use of the name property for cluster query.

A rough draft I have is pushed here: danielhelfand@89b705e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant