Skip to content

Commit

Permalink
Add ability to enable/disable hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Koen de Laat <[email protected]>
  • Loading branch information
koendelaat committed Oct 17, 2024
1 parent c41d510 commit 295986d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/kubevirt/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description: A Helm chart for KubeVirt
icon: https://raw.githubusercontent.com/cncf/artwork/main/projects/kubevirt/icon/color/kubevirt-icon-color.svg
name: kubevirt
type: application
version: 0.4.0
version: 0.4.1
2 changes: 2 additions & 0 deletions packages/kubevirt/charts/templates/crd-uninstall-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hooksEnabled.crd.uninstall }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -53,3 +54,4 @@ spec:
- kubevirts.kubevirt.io
securityContext:
{{- toYaml .Values.hookSecurityContext | nindent 12 }}
{{- end }}
2 changes: 2 additions & 0 deletions packages/kubevirt/charts/templates/crd-upgrade-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hooksEnabled.crd.upgrade }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -78,3 +79,4 @@ spec:
items:
- key: crd
path: crd.yaml
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hooksEnabled.kubevirt.uninstall }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -69,3 +70,4 @@ spec:
- deployments/virt-controller
- daemonsets/virt-handler
- --timeout=60s
{{- end }}
2 changes: 2 additions & 0 deletions packages/kubevirt/charts/templates/namespace-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hooksEnabled.namespace }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -58,3 +59,4 @@ spec:
- {{ .Release.Namespace }}
- kubevirt.io=
- pod-security.kubernetes.io/enforce=privileged
{{- end }}
7 changes: 7 additions & 0 deletions packages/kubevirt/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ kubevirt:
monitorAccount: ""
monitorNamespace: ""

hooksEnabled:
crd:
upgrade: true
uninstall: true
kubevirt:
uninstall: true
namespace: true
hookImage: rancher/kubectl:v1.30.2
hookRestartPolicy: OnFailure
hookSecurityContext:
Expand Down
2 changes: 1 addition & 1 deletion packages/kubevirt/package.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
url: local
version: 0.4.0
version: 0.4.1

0 comments on commit 295986d

Please sign in to comment.