-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a pre-delete helm hook to clean up webhook configs
Signed-off-by: amaslennikov <[email protected]>
- Loading branch information
1 parent
ee40683
commit aab1735
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
deployment/sriov-network-operator-chart/templates/predeletehook.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |