Skip to content

Commit e5c9fe4

Browse files
authored
chore: merge pod labels and annotations with common labels and annotations (#41)
1 parent 7e86a30 commit e5c9fe4

2 files changed

Lines changed: 4 additions & 20 deletions

File tree

kafka-topic-creator/helm/templates/kafka-topic-creation-hook.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@ spec:
1313
metadata:
1414
labels:
1515
app: {{ .Values.jobName }}
16-
{{- with .Values.podLabels }}
16+
{{- with merge .Values.podLabels .Values.commonPodLabels }}
1717
{{- toYaml . | nindent 8 }}
1818
{{- end }}
19-
{{- with .Values.commonPodLabels }}
20-
{{- toYaml . | nindent 8 }}
21-
{{- end }}
22-
{{- if or .Values.podAnnotations .Values.commonPodAnnotations }}
19+
{{- with merge .Values.podAnnotations .Values.commonPodAnnotations }}
2320
annotations:
24-
{{- with .Values.podAnnotations }}
25-
{{- toYaml . | nindent 8 }}
26-
{{- end}}
27-
{{- with .Values.commonPodAnnotations }}
2821
{{- toYaml . | nindent 8 }}
29-
{{- end}}
3022
{{- end }}
3123
spec:
3224
containers:

kstreams-app-version-checker/helm/templates/job.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,12 @@ spec:
1818
labels:
1919
app: {{ $jobName }}
2020
release: {{ .Release.Name }}
21-
{{- with .Values.podLabels}}
21+
{{- with merge .Values.podLabels .Values.commonPodLabels }}
2222
{{- toYaml . | nindent 8 }}
2323
{{- end }}
24-
{{- with .Values.commonPodLabels }}
25-
{{- toYaml . | nindent 8 }}
26-
{{- end }}
27-
{{- if or .Values.podAnnotations .Values.commonPodAnnotations }}
24+
{{- with merge .Values.podAnnotations .Values.commonPodAnnotations }}
2825
annotations:
29-
{{- with .Values.podAnnotations }}
30-
{{- toYaml . | nindent 8 }}
31-
{{- end}}
32-
{{- with .Values.commonPodAnnotations }}
3326
{{- toYaml . | nindent 8 }}
34-
{{- end}}
3527
{{- end }}
3628
spec:
3729
{{- with .Values.podSecurityContext }}

0 commit comments

Comments
 (0)