Skip to content

Commit

Permalink
Cleanup default Function & Tasks while uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
hossainemruz committed Jul 1, 2019
1 parent eee9587 commit e74b4e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion chart/stash/templates/cleaner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions deploy/stash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}'))
Expand Down

0 comments on commit e74b4e8

Please sign in to comment.