Skip to content

Commit 5640ecd

Browse files
authored
Added option to override/define templates for additional sidecars and volumes. (#17)
1 parent de9e2f3 commit 5640ecd

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

charts/zookeeper-operator/templates/_helpers.tpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,18 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
3535
app.kubernetes.io/managed-by: {{ .Release.Service }}
3636
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
3737
{{- end -}}
38+
39+
40+
{{/*
41+
Default sidecar template
42+
*/}}
43+
{{- define "chart.additionalSidecars"}}
44+
{{ toYaml .Values.additionalSidecars }}
45+
{{- end}}
46+
47+
{{/*
48+
Default volume template
49+
*/}}
50+
{{- define "chart.additionalVolumes"}}
51+
{{ toYaml .Values.additionalVolumes }}
52+
{{- end}}

charts/zookeeper-operator/templates/operator.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
serviceAccountName: {{ .Values.serviceAccount.name }}
2424
{{- if .Values.additionalVolumes }}
2525
volumes:
26-
{{ toYaml .Values.additionalVolumes | indent 6 }}
26+
{{- include "chart.additionalVolumes" . | indent 6 }}
2727
{{- end }}
2828
containers:
2929
- name: {{ template "zookeeper-operator.fullname" . }}
@@ -51,7 +51,7 @@ spec:
5151
{{ toYaml .Values.resources | indent 10 }}
5252
{{- end }}
5353
{{- if .Values.additionalSidecars }}
54-
{{ toYaml .Values.additionalSidecars | indent 6 }}
54+
{{- include "chart.additionalSidecars" . | indent 6 }}
5555
{{- end }}
5656
{{- if .Values.nodeSelector }}
5757
nodeSelector:

0 commit comments

Comments
 (0)