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

Update uninstall.sh #164

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


KEEP_PROVIDERS=0
OCM_NAMESPACE=open-cluster-management

# save args to pass to called scripts
args=("$@")
Expand Down Expand Up @@ -46,18 +47,40 @@ printf "\n"
oc cluster-info | head -n 1 | awk '{print $NF}'
printf "\n"

./clean-clusters.sh "$args"
if [ -z ${OCM_NAMESPACE+x} ];
then
echo "OCM_NAMESPACE must be set"
exit 1
else
echo "Cleaning up resources in namespace: $OCM_NAMESPACE"
fi
oc delete mch --all -n $OCM_NAMESPACE
## Delete all helm charts in given namespace
helm ls --namespace $OCM_NAMESPACE | cut -f 1 | tail -n +2 | xargs -n 1 helm delete --namespace $OCM_NAMESPACE
oc delete apiservice v1.admission.cluster.open-cluster-management.io v1beta1.webhook.certmanager.k8s.io v1.admission.cluster.open-cluster-management.io v1.admission.work.open-cluster-management.io
oc delete clusterimageset --all
oc delete configmap -n $OCM_NAMESPACE cert-manager-controller cert-manager-cainjector-leader-election cert-manager-cainjector-leader-election-core
oc delete consolelink acm-console-link
oc delete crd klusterletaddonconfigs.agent.open-cluster-management.io placementbindings.policy.open-cluster-management.io policies.policy.open-cluster-management.io userpreferences.console.open-cluster-management.io
oc delete mutatingwebhookconfiguration cert-manager-webhook-v1alpha1
oc delete oauthclient multicloudingress
oc delete rolebinding -n kube-system cert-manager-webhook-webhook-authentication-reader
oc delete scc kui-proxy-scc
oc delete validatingwebhookconfiguration cert-manager-webhook-v1alpha1
exit 0

#./clean-clusters.sh "$args"

kubectl delete -k multiclusterhub/
echo "Sleeping for 200 seconds to allow resources to finalize ..."
sleep 200
#kubectl delete -k multiclusterhub/
#echo "Sleeping for 200 seconds to allow resources to finalize ..."
#sleep 200

kubectl delete -k multicluster-hub-operator/
./multicluster-hub-operator/uninstall.sh
#kubectl delete -k multicluster-hub-operator/
#./multicluster-hub-operator/uninstall.sh

kubectl delete -k acm-operator/
./acm-operator/uninstall.sh
#kubectl delete -k acm-operator/
#./acm-operator/uninstall.sh

kubectl delete -k community-subscriptions/
#kubectl delete -k community-subscriptions/

exit 0