Skip to content

Commit

Permalink
Remove enableHelmHooks
Browse files Browse the repository at this point in the history
Signed-off-by: JenTing Hsiao <[email protected]>
  • Loading branch information
JenTing Hsiao committed Mar 5, 2021
1 parent dafb9d9 commit df35d6c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 31 deletions.
8 changes: 0 additions & 8 deletions charts/velero/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,3 @@ Create the volume snapshot location provider
{{ default .provider .volumeSnapshotLocation.provider }}
{{- end -}}
{{- end -}}

{{/*
Helm hooks for Helm v2 CRDs
*/}}
{{- define "velero.helmhooks.crds" -}}
{{ print "\"helm.sh/hook\": pre-install,pre-upgrade" | indent 4 }}
{{ print "\"helm.sh/hook-delete-policy\": \"before-hook-creation\"" | indent 4 }}
{{- end -}}
2 changes: 0 additions & 2 deletions charts/velero/templates/backupstoragelocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ kind: BackupStorageLocation
metadata:
name: {{ include "velero.backupStorageLocation.name" . }}
annotations:
{{- if .Values.enableHelmHooks }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
labels:
app.kubernetes.io/name: {{ include "velero.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Expand Down
13 changes: 1 addition & 12 deletions charts/velero/templates/crds.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
{{- if and .Values.installCRDs (eq .Release.Service "Tiller") }}
{{- if .Values.installCRDs }}
{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }}
{{- if not $.Values.enableHelmHooks }}
{{ $.Files.Get $path }}
{{- else }}
{{- range $.Files.Lines $path }}
{{- if contains "annotations:" . }}
{{ . }}
{{ template "velero.helmhooks.crds" . }}
{{- else }}
{{ . }}
{{- end }}
{{- end }}
{{- end }}
---
{{- end }}
{{- end }}
2 changes: 0 additions & 2 deletions charts/velero/templates/schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ metadata:
{{- if $schedule.annotations }}
{{- toYaml $schedule.annotations | nindent 4 }}
{{- end }}
{{- if $.Values.enableHelmHooks }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
labels:
app.kubernetes.io/name: {{ include "velero.name" $ }}
app.kubernetes.io/instance: {{ $.Release.Name }}
Expand Down
2 changes: 0 additions & 2 deletions charts/velero/templates/volumesnapshotlocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ kind: VolumeSnapshotLocation
metadata:
name: {{ include "velero.volumeSnapshotLocation.name" . }}
annotations:
{{- if .Values.enableHelmHooks }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- end }}
labels:
app.kubernetes.io/name: {{ include "velero.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Expand Down
5 changes: 0 additions & 5 deletions charts/velero/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ metrics:
# Install CRDs as a templates. Enabled by default.
installCRDs: true

# Enable/disable all helm hooks annotations
# You should disable this if using a deploy tool that doesn't support helm hooks,
# such as ArgoCD
enableHelmHooks: true

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

0 comments on commit df35d6c

Please sign in to comment.