Skip to content

Commit

Permalink
fix: helm pre-delete-hook to delete custom ressoruces before operator…
Browse files Browse the repository at this point in the history
… (else namespace gets sutck)
  • Loading branch information
joseftaha committed Jul 16, 2024
1 parent 8694572 commit c60f90c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions chart/config-server-operator/templates/pre-delete-hook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: batch/v1
kind: Job
metadata:
name: delete-custom-resources
namespace: "{{ .Values.namespace }}"
annotations:
"helm.sh/hook": pre-delete
spec:
template:
spec:
serviceAccountName: config-server-service-account
containers:
- name: delete-custom-resources
image: bitnami/kubectl:latest
command:
- /bin/sh
- -c
- |
kubectl delete cfg-server --all -n {{ .Values.namespace }}
restartPolicy: OnFailure

0 comments on commit c60f90c

Please sign in to comment.