From 2f29b8dd13198e74a1317f74972aa53f063e3040 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sat, 24 Mar 2018 06:36:28 -0700 Subject: [PATCH] Reorg objects deleted in uninstall command (#389) --- hack/deploy/stash.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hack/deploy/stash.sh b/hack/deploy/stash.sh index fec771766..c21a81251 100755 --- a/hack/deploy/stash.sh +++ b/hack/deploy/stash.sh @@ -162,16 +162,18 @@ while test $# -gt 0; do done if [ "$STASH_UNINSTALL" -eq 1 ]; then + # delete webhooks and apiservices + kubectl delete validatingwebhookconfiguration -l app=stash + kubectl delete mutatingwebhookconfiguration -l app=stash + kubectl delete apiservice -l app=stash + # delete stash operator kubectl delete deployment -l app=stash --namespace $STASH_NAMESPACE kubectl delete service -l app=stash --namespace $STASH_NAMESPACE kubectl delete secret -l app=stash --namespace $STASH_NAMESPACE - kubectl delete validatingwebhookconfiguration -l app=stash --namespace $STASH_NAMESPACE - kubectl delete mutatingwebhookconfiguration -l app=stash --namespace $STASH_NAMESPACE - kubectl delete apiservice -l app=stash --namespace $STASH_NAMESPACE - # Delete RBAC objects, if --rbac flag was used. + # delete RBAC objects, if --rbac flag was used. kubectl delete serviceaccount -l app=stash --namespace $STASH_NAMESPACE - kubectl delete clusterrolebindings -l app=stash --namespace $STASH_NAMESPACE - kubectl delete clusterrole -l app=stash --namespace $STASH_NAMESPACE + kubectl delete clusterrolebindings -l app=stash + kubectl delete clusterrole -l app=stash kubectl delete rolebindings -l app=stash --namespace $STASH_NAMESPACE kubectl delete role -l app=stash --namespace $STASH_NAMESPACE