Skip to content

Commit

Permalink
Add a pre-delete helm hook to clean up webhook configs
Browse files Browse the repository at this point in the history
Signed-off-by: amaslennikov <[email protected]>
  • Loading branch information
almaslennikov committed Jul 29, 2024
1 parent ee40683 commit aab1735
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ if .Values.operator.admissionControllers.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ include "sriov-network-operator.fullname" . }}-post-delete-hook"
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
spec:
template:
spec:
serviceAccountName: {{ include "sriov-network-operator.fullname" . }}
containers:
- name: cleanup
image: bitnami/kubectl:latest
command:
- /bin/sh
- -c
- |
kubectl delete MutatingWebhookConfiguration -n {{ .Release.Namespace }} sriov-operator-webhook-config network-resources-injector-config
kubectl delete ValidatingWebhookConfiguration -n {{ .Release.Namespace }} sriov-operator-webhook-config
restartPolicy: Never
{{ end }}

0 comments on commit aab1735

Please sign in to comment.