Skip to content

Update KubeSphere delete scripts, fix issue delete other namespace

Calvin Yu请求将github/fork/tanrobotix/master合并到master

Created by: tanrobotix

The issue is if there is another namespace that its name is the word in dict. It will be catch by grep then execute. For instance: if there is a monitoring namespace (create by prometheus-operator):

++ for namespace in '`kubectl get namespaces|awk '\''{print $1}'\''|grep -v NAME`'
+++ echo kubesphere-system openpitrix-system kubesphere-monitoring-system kubesphere-alerting-system kubesphere-controls-system
+++ grep monitoring
++ result='kubesphere-system openpitrix-system kubesphere-monitoring-system kubesphere-alerting-system kubesphere-controls-system'
++ [[ kubesphere-system openpitrix-system kubesphere-monitoring-system kubesphere-alerting-system kubesphere-controls-system != '' ]]
++ echo 'kubectl delete all --all -n monitoring'
kubectl delete all --all -n monitoring

I had edit the script, provide some bash pipeline. You can take look. Thank you

合并请求报告