Skip to content

Commit 6562f79

Browse files
feat: global tolertions/nodeSelector/affinity
1 parent 344102d commit 6562f79

File tree

1 file changed

+6
-6
lines changed
  • charts/cf-common/templates/controller

1 file changed

+6
-6
lines changed

charts/cf-common/templates/controller/_pod.tpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,21 @@ nodeSelector: {{ toYaml . | nindent 2 }}
9292

9393
{{- $tolerations := .Values.tolerations | default list }}
9494
{{- $globalTolerations := .Values.global.tolerations | default list }}
95+
{{- if or (not (kindIs "slice" $tolerations)) (not (kindIs "slice" $globalTolerations)) }}
96+
{{- fail "ERROR: tolerations block must be a list!" }}
97+
{{- end }}
9598
{{- $allToleration := concat $globalTolerations $tolerations }}
9699
{{- with $allToleration }}
97-
{{- if not (kindIs "slice" .) }}
98-
{{- fail "ERROR: tolerations block must be a list!" }}
99-
{{- end }}
100100
tolerations: {{ toYaml . | nindent 2 }}
101101
{{- end }}
102102

103103
{{- $affinity := .Values.affinity | default dict }}
104104
{{- $globalAffinity := .Values.global.affinity | default dict }}
105+
{{- if or (not (kindIs "map" $affinity)) (not (kindIs "map" $globalAffinity)) }}
106+
{{- fail "ERROR: affinity block must be a map!" }}
107+
{{- end }}
105108
{{- $allAffinity := mergeOverwrite $globalAffinity $affinity }}
106109
{{- with $allAffinity }}
107-
{{- if not (kindIs "map" .) }}
108-
{{- fail "ERROR: affinity block must be a map!" }}
109-
{{- end }}
110110
affinity: {{ toYaml . | nindent 2 }}
111111
{{- end }}
112112

0 commit comments

Comments
 (0)