Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: backport a pre-delete helm hook for sriov-network-operator #1013

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if these CRs are not available? Will the Job fail?
Do we need ; at the end?
Maybe add || true;

kubectl delete ValidatingWebhookConfiguration -n {{ .Release.Namespace }} sriov-operator-webhook-config
restartPolicy: Never
{{ end }}
Loading