Skip to content

Commit 72e29f9

Browse files
committed
inline the custom-annotations template based on feedback
1 parent 8bc5546 commit 72e29f9

File tree

4 files changed

+57
-26
lines changed

4 files changed

+57
-26
lines changed

templates/_helpers.tpl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,6 @@ Create the name of the stackstorm-ha service account to use
105105
{{- end }}
106106
{{- end -}}
107107

108-
# Reusable annotations list
109-
{{- define "custom-annotations" -}}
110-
{{- if .annotations }}
111-
{{ toYaml .annotations }}
112-
{{- end }}
113-
{{- end -}}
114-
115108
# For custom st2packs-Container reduce duplicity by defining it here once
116109
{{- define "packs-volumes" -}}
117110
{{- if .Values.st2.packs.images }}

templates/deployments.yaml

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ spec:
3535
annotations:
3636
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
3737
checksum/auth: {{ include (print $.Template.BasePath "/secrets_st2auth.yaml") . | sha256sum }}
38-
{{ include "custom-annotations" .Values.st2auth | indent 8 }}
38+
{{- if .Values.st2auth.annotations }}
39+
{{ toYaml .Values.st2auth.annotations | indent 8 }}
40+
{{- end }}
3941
spec:
4042
imagePullSecrets:
4143
{{- if .Values.image.pullSecret }}
@@ -146,7 +148,9 @@ spec:
146148
annotations:
147149
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
148150
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
149-
{{ include "custom-annotations" .Values.st2api | indent 8 }}
151+
{{- if .Values.st2api.annotations }}
152+
{{ toYaml .Values.st2api.annotations | indent 8 }}
153+
{{- end }}
150154
spec:
151155
imagePullSecrets:
152156
{{- if .Values.image.pullSecret }}
@@ -257,7 +261,9 @@ spec:
257261
heritage: {{ .Release.Service }}
258262
annotations:
259263
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
260-
{{ include "custom-annotations" .Values.st2stream | indent 8 }}
264+
{{- if .Values.st2stream.annotations }}
265+
{{ toYaml .Values.st2stream.annotations | indent 8 }}
266+
{{- end }}
261267
spec:
262268
imagePullSecrets:
263269
{{- if .Values.image.pullSecret }}
@@ -336,7 +342,9 @@ spec:
336342
heritage: {{ .Release.Service }}
337343
annotations:
338344
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2web.yaml") . | sha256sum }}
339-
{{ include "custom-annotations" .Values.st2web | indent 8 }}
345+
{{- if .Values.st2web.annotations }}
346+
{{ toYaml .Values.st2web.annotations | indent 8 }}
347+
{{- end }}
340348
spec:
341349
imagePullSecrets:
342350
{{- if .Values.image.pullSecret }}
@@ -435,7 +443,9 @@ spec:
435443
heritage: {{ .Release.Service }}
436444
annotations:
437445
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
438-
{{ include "custom-annotations" .Values.st2rulesengine | indent 8 }}
446+
{{- if .Values.st2rulesengine.annotations }}
447+
{{ toYaml .Values.st2rulesengine.annotations | indent 8 }}
448+
{{- end }}
439449
spec:
440450
imagePullSecrets:
441451
{{- if .Values.image.pullSecret }}
@@ -523,7 +533,9 @@ spec:
523533
heritage: {{ .Release.Service }}
524534
annotations:
525535
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
526-
{{ include "custom-annotations" .Values.st2timersengine | indent 8 }}
536+
{{- if .Values.st2timersengine.annotations }}
537+
{{ toYaml .Values.st2timersengine.annotations | indent 8 }}
538+
{{- end }}
527539
spec:
528540
imagePullSecrets:
529541
{{- if .Values.image.pullSecret }}
@@ -603,7 +615,9 @@ spec:
603615
annotations:
604616
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
605617
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
606-
{{ include "custom-annotations" .Values.st2workflowengine | indent 8 }}
618+
{{- if .Values.st2workflowengine.annotations }}
619+
{{ toYaml .Values.st2workflowengine.annotations | indent 8 }}
620+
{{- end }}
607621
spec:
608622
imagePullSecrets:
609623
{{- if .Values.image.pullSecret }}
@@ -695,7 +709,9 @@ spec:
695709
annotations:
696710
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
697711
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
698-
{{ include "custom-annotations" .Values.st2scheduler | indent 8 }}
712+
{{- if .Values.st2scheduler.annotations }}
713+
{{ toYaml .Values.st2scheduler.annotations | indent 8 }}
714+
{{- end }}
699715
spec:
700716
imagePullSecrets:
701717
{{- if .Values.image.pullSecret }}
@@ -787,7 +803,9 @@ spec:
787803
heritage: {{ .Release.Service }}
788804
annotations:
789805
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
790-
{{ include "custom-annotations" .Values.st2notifier | indent 8 }}
806+
{{- if .Values.st2notifier.annotations }}
807+
{{ toYaml .Values.st2notifier.annotations | indent 8 }}
808+
{{- end }}
791809
spec:
792810
imagePullSecrets:
793811
{{- if .Values.image.pullSecret }}
@@ -871,7 +889,9 @@ spec:
871889
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") $ | sha256sum }}
872890
checksum/packs: {{ include (print $.Template.BasePath "/configmaps_packs.yaml") $ | sha256sum }}
873891
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") $ | sha256sum }}
874-
{{ include "custom-annotations" . | indent 8 }}
892+
{{- if .annotations }}
893+
{{ toYaml .annotations | indent 8 }}
894+
{{- end }}
875895
spec:
876896
imagePullSecrets:
877897
{{- if $.Values.image.pullSecret }}
@@ -999,7 +1019,9 @@ spec:
9991019
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
10001020
checksum/ssh: {{ include (print $.Template.BasePath "/secrets_ssh.yaml") . | sha256sum }}
10011021
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
1002-
{{ include "custom-annotations" .Values.st2actionrunner | indent 8 }}
1022+
{{- if .Values.st2actionrunner.annotations }}
1023+
{{ toYaml .Values.st2actionrunner.annotations | indent 8 }}
1024+
{{- end }}
10031025
spec:
10041026
{{- if .Values.st2actionrunner.hostAliases }}
10051027
hostAliases:
@@ -1123,7 +1145,9 @@ spec:
11231145
heritage: {{ .Release.Service }}
11241146
annotations:
11251147
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
1126-
{{ include "custom-annotations" .Values.st2garbagecollector | indent 8 }}
1148+
{{- if .Values.st2garbagecollector.annotations }}
1149+
{{ toYaml .Values.st2garbagecollector.annotations | indent 8 }}
1150+
{{- end }}
11271151
spec:
11281152
imagePullSecrets:
11291153
{{- if .Values.image.pullSecret }}
@@ -1205,7 +1229,9 @@ spec:
12051229
checksum/auth: {{ include (print $.Template.BasePath "/secrets_st2auth.yaml") . | sha256sum }}
12061230
checksum/ssh: {{ include (print $.Template.BasePath "/secrets_ssh.yaml") . | sha256sum }}
12071231
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
1208-
{{ include "custom-annotations" .Values.st2client | indent 8 }}
1232+
{{- if .Values.st2client.annotations }}
1233+
{{ toYaml .Values.st2client.annotations | indent 8 }}
1234+
{{- end }}
12091235
spec:
12101236
imagePullSecrets:
12111237
{{- if .Values.st2.packs.images }}
@@ -1374,7 +1400,9 @@ spec:
13741400
heritage: {{ .Release.Service }}
13751401
annotations:
13761402
checksum/chatops: {{ include (print $.Template.BasePath "/secrets_st2chatops.yaml") . | sha256sum }}
1377-
{{ include "custom-annotations" .Values.st2chatops | indent 8 }}
1403+
{{- if .Values.st2chatops.annotations }}
1404+
{{ toYaml .Values.st2chatops.annotations | indent 8 }}
1405+
{{- end }}
13781406
spec:
13791407
{{- if .Values.image.pullSecret }}
13801408
imagePullSecrets:

templates/ingress.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ metadata:
1515
{{- if .Values.ingress.tls }}
1616
ingress.kubernetes.io/secure-backends: "true"
1717
{{- end }}
18-
{{ include "custom-annotations" .Values.ingress | indent 4 }}
18+
{{- if .Values.ingress.annotations }}
19+
{{ toYaml .Values.ingress.annotations | indent 4 }}
20+
{{- end }}
1921
spec:
2022
rules:
2123
{{- range .Values.ingress.hosts }}

templates/jobs.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ spec:
3030
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
3131
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
3232
checksum/rbac: {{ include (print $.Template.BasePath "/configmaps_rbac.yaml") . | sha256sum }}
33+
{{- if .Values.jobs.annotations }}
34+
{{ toYaml .Values.jobs.annotations | indent 8 }}
35+
{{- end }}
3336
spec:
3437
imagePullSecrets:
3538
{{- if .Values.image.pullSecret }}
@@ -58,7 +61,6 @@ spec:
5861
mountPath: /opt/stackstorm/rbac/assignments/
5962
- name: st2-rbac-mappings-vol
6063
mountPath: /opt/stackstorm/rbac/mappings/
61-
{{ include "custom-annotations" .Values.jobs | indent 8 }}
6264
# TODO: Find out default resource limits for this specific service (#5)
6365
#resources:
6466
volumes:
@@ -108,6 +110,9 @@ spec:
108110
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
109111
checksum/urls: {{ include (print $.Template.BasePath "/configmaps_st2-urls.yaml") . | sha256sum }}
110112
checksum/apikeys: {{ include (print $.Template.BasePath "/secrets_st2apikeys.yaml") . | sha256sum }}
113+
{{- if .Values.jobs.annotations }}
114+
{{ toYaml .Values.jobs.annotations | indent 8 }}
115+
{{- end }}
111116
spec:
112117
imagePullSecrets:
113118
{{- if .Values.image.pullSecret }}
@@ -173,7 +178,6 @@ spec:
173178
- name: st2-apikeys-vol
174179
mountPath: /etc/st2/apikeys.yaml
175180
subPath: apikeys.yaml
176-
{{ include "custom-annotations" .Values.jobs | indent 8 }}
177181
# TODO: Find out default resource limits for this specific service (#5)
178182
#resources:
179183
volumes:
@@ -216,6 +220,9 @@ spec:
216220
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
217221
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
218222
checksum/urls: {{ include (print $.Template.BasePath "/configmaps_st2-urls.yaml") . | sha256sum }}
223+
{{- if .Values.jobs.annotations }}
224+
{{ toYaml .Values.jobs.annotations | indent 8 }}
225+
{{- end }}
219226
spec:
220227
imagePullSecrets:
221228
{{- if .Values.image.pullSecret }}
@@ -278,7 +285,6 @@ spec:
278285
- name: st2-kv-vol
279286
mountPath: /etc/st2/st2kv.yaml
280287
subPath: st2kv.yaml
281-
{{ include "custom-annotations" .Values.jobs | indent 8 }}
282288
# TODO: Find out default resource limits for this specific service (#5)
283289
#resources:
284290
volumes:
@@ -324,6 +330,9 @@ spec:
324330
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
325331
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
326332
checksum/packs: {{ include (print $.Template.BasePath "/configmaps_packs.yaml") . | sha256sum }}
333+
{{- if .Values.jobs.annotations }}
334+
{{ toYaml .Values.jobs.annotations | indent 8 }}
335+
{{- end }}
327336
spec:
328337
imagePullSecrets:
329338
{{- if .Values.image.pullSecret }}
@@ -363,7 +372,6 @@ spec:
363372
- name: st2-virtualenvs-vol
364373
mountPath: /opt/stackstorm/virtualenvs/
365374
{{- end }}
366-
{{ include "custom-annotations" .Values.jobs | indent 8 }}
367375
# TODO: Find out default resource limits for this specific service (#5)
368376
#resources:
369377
volumes:

0 commit comments

Comments
 (0)