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
feat: add prompting to confirm remove of cluster resources #10319
Conversation
The test result: $ ./argocd cluster rm test
Are you sure you want to remove 'test' and all its resources? [y/n] y
Cluster 'test' removed
INFO[0002] ClusterRoleBinding "argocd-manager-role-binding" deleted
INFO[0003] ClusterRole "argocd-manager-role" deleted
INFO[0003] ServiceAccount "argocd-manager" deleted $ ./argocd cluster rm test -y
Cluster 'test' removed
INFO[0000] ClusterRoleBinding "argocd-manager-role-binding" deleted
INFO[0001] ClusterRole "argocd-manager-role" deleted
INFO[0001] ServiceAccount "argocd-manager" deleted $ ./argocd cluster rm test local
Are you sure you want to remove 'test' and all its resources? [y/n/A] where 'A' is to remove all specified apps and their resources without prompting A
Cluster 'test' removed
INFO[0002] ClusterRoleBinding "argocd-manager-role-binding" deleted
INFO[0003] ClusterRole "argocd-manager-role" deleted
INFO[0003] ServiceAccount "argocd-manager" deleted
Cluster 'local' removed
INFO[0003] ClusterRoleBinding "argocd-manager-role-binding" deleted
INFO[0004] ClusterRole "argocd-manager-role" deleted
INFO[0004] ServiceAccount "argocd-manager" deleted |
Codecov Report
@@ Coverage Diff @@
## master #10319 +/- ##
==========================================
- Coverage 45.92% 45.89% -0.04%
==========================================
Files 229 229
Lines 28278 28299 +21
==========================================
Hits 12987 12987
- Misses 13518 13539 +21
Partials 1773 1773
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
f225498
to
fe88da4
Compare
/cc @crenshaw-dev Hi, can you help me review this PR? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually unfamiliar with the effects of deleting a cluster. Does it actually delete all the apps and their resources if they're deployed to that cluster? Or does it just cause those apps to go into "unknown" sync status and health?
I tested it, it cause those apps to go into "unknown" sync status and health: $ argocd cluster rm https://10.29.12.61:16443
Cluster 'https://10.29.12.61:16443' removed
# this will hang
$ argocd app sync guest2
TIMESTAMP GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
2022-08-18T22:51:17+08:00 Service default guestbook-ui Synced Healthy
2022-08-18T22:51:17+08:00 apps Deployment default guestbook-ui Synced Healthy
^C
# the apps go into "unknown" sync status and health
$ argocd app list
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH SYNCPOLICY CONDITIONS REPO PATH TARGET
guest2 https://10.29.12.61:16443 default default Unknown Unknown <none> InvalidSpecError https://gitlab.daocloud.cn/xin.li/argocd-example.git guestbook |
Signed-off-by: xin.li <xin.li@daocloud.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Add prompting to confirm remove of cluster resources
Checklist: