From e74b4e849e66a9305938ff3ee2f3cbe82bf78b67 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Mon, 1 Jul 2019 19:20:27 +0600 Subject: [PATCH] Cleanup default Function & Tasks while uninstall --- chart/stash/templates/cleaner.yaml | 6 +++++- deploy/stash.sh | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/chart/stash/templates/cleaner.yaml b/chart/stash/templates/cleaner.yaml index a5ad6a0a5..17ce94a8b 100644 --- a/chart/stash/templates/cleaner.yaml +++ b/chart/stash/templates/cleaner.yaml @@ -23,6 +23,10 @@ spec: command: - sh - -c - - "sleep 2; kubectl delete validatingwebhookconfigurations admission.stash.appscode.com || true; kubectl delete mutatingwebhookconfiguration admission.stash.appscode.com || true" + - "sleep 2; \ + kubectl delete validatingwebhookconfigurations admission.stash.appscode.com || true; \ + kubectl delete mutatingwebhookconfiguration admission.stash.appscode.com || true; \ + kubectl delete function update-status pvc-backup pvc-restore || true; \ + kubectl delete task pvc-backup pvc-restore" imagePullPolicy: {{ .Values.imagePullPolicy }} restartPolicy: Never diff --git a/deploy/stash.sh b/deploy/stash.sh index c8f30f3b6..38cb02bb6 100755 --- a/deploy/stash.sh +++ b/deploy/stash.sh @@ -351,8 +351,11 @@ if [ "$STASH_UNINSTALL" -eq 1 ]; then kubectl delete secret stash-apiserver-cert --namespace $PROMETHEUS_NAMESPACE || true # delete psp resources kubectl delete psp stash-operator-psp stash-backup-job stash-backupsession-cron stash-restore-job || true - # delete update-status function - kubectl delete function update-status || true + # delete default functions + kubectl delete function update-status pvc-backup pvc-restore || true + # delete default tasks + kubectl delete task pvc-backup pvc-restore || true + echo "waiting for stash operator pod to stop running" for (( ; ; )); do pods=($(kubectl get pods --namespace $STASH_NAMESPACE -l app=stash -o jsonpath='{range .items[*]}{.metadata.name} {end}'))