Skip to content

Commit

Permalink
Make one variable for all hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Cezar <[email protected]>
  • Loading branch information
igorcezar committed Oct 15, 2020
1 parent 0d0acb0 commit cec4978
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/velero/templates/backupstoragelocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: BackupStorageLocation
metadata:
name: {{ include "velero.backupStorageLocation.name" . }}
annotations:
{{- if .Values.enableHelmHooks.templates }}
{{- if .Values.enableHelmHooks }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/velero/templates/crds.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if and .Values.installCRDs (eq .Release.Service "Tiller") }}
{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }}
{{- if $.Values.enableHelmHooks.crds }}
{{- if $.Values.enableHelmHooks }}
{{ $.Files.Get $path }}
{{- else }}
{{- range $.Files.Lines $path }}
Expand Down
2 changes: 1 addition & 1 deletion charts/velero/templates/schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Schedule
metadata:
name: {{ include "velero.fullname" $ }}-{{ $scheduleName }}
annotations:
{{- if $.Values.enableHelmHooks.templates }}
{{- if $.Values.enableHelmHooks }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/velero/templates/volumesnapshotlocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: VolumeSnapshotLocation
metadata:
name: {{ include "velero.volumeSnapshotLocation.name" . }}
annotations:
{{- if .Values.enableHelmHooks.templates }}
{{- if .Values.enableHelmHooks }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
Expand Down
6 changes: 2 additions & 4 deletions charts/velero/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ metrics:
# Install CRDs as a templates. Enabled by default.
installCRDs: true

# Enable/disable helm hooks annotations for Helm v2 in CRDs and/or templates
# Enable/disable helm hooks annotations for CRDs (Helm v2) and templates
# You should disable this if using a deploy tool that doesn't support helm hooks
enableHelmHooks:
crds: true
templates: true
enableHelmHooks: true

##
## End of deployment-related settings.
Expand Down

0 comments on commit cec4978

Please sign in to comment.