Skip to content

Commit d199ec6

Browse files
committed
refactor(occm): define helper template for podAnnotations
1 parent f299b4d commit d199ec6

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

charts/openstack-cloud-controller-manager/templates/_helpers.tpl

+15-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,24 @@ component: controllermanager
3030
{{- define "occm.controllermanager.labels" -}}
3131
{{ include "occm.controllermanager.matchLabels" . }}
3232
{{ include "occm.common.metaLabels" . }}
33-
{{- range $key, $val := .Values.podLabels }}
34-
{{ $key }}: {{ $val }}
33+
{{ if .Values.podLabels }}
34+
{{- toYaml .Values.podLabels }}
3535
{{- end }}
3636
{{- end -}}
3737

38+
{{/*
39+
Common annotations and pod annotations
40+
*/}}
41+
{{- define "occm.controllermanager.annotations" -}}
42+
{{- if .Values.commonAnnotations }}
43+
{{- toYaml .Values.commonAnnotations }}
44+
{{- end }}
45+
{{ if .Values.podAnnotations }}
46+
{{- toYaml .Values.podAnnotations }}
47+
{{- end }}
48+
{{- end -}}
49+
50+
3851
{{/*
3952
Create cloud-config makro.
4053
*/}}

charts/openstack-cloud-controller-manager/templates/daemonset.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ spec:
1818
metadata:
1919
annotations:
2020
checksum/config: {{ include "cloudConfig" . | sha256sum }}
21-
{{- with .Values.commonAnnotations }}
22-
{{- toYaml . | nindent 8 }}
23-
{{- end }}
24-
{{- with .Values.podAnnotations }}
25-
{{- toYaml . | nindent 8 }}
26-
{{- end }}
21+
{{- include "occm.controllermanager.annotations" . | nindent 8 }}
2722
labels:
2823
{{- include "occm.controllermanager.labels" . | nindent 8 }}
2924
spec:

0 commit comments

Comments
 (0)