Skip to content

Commit 89f9f02

Browse files
committed
Topology Spread Constraints Bugfix
- Fixed loop in topology spread constraint helper definition
1 parent 49f32c3 commit 89f9f02

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

chart/templates/_helpers.tpl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,14 @@ toleration generates toleration settings for the CSI Driver.
471471
topologySpreadConstraints appends the "vso.chart.selectorLabels" to .Values.controller.topologySpreadConstraints if no labelSelector was specified
472472
*/}}
473473
{{- define "vso.topologySpreadConstraints" -}}
474-
{{- $defaultLabelSelector := dict "labelSelector" (dict "matchLabels" (include "vso.chart.selectorLabels" . | fromYaml)) -}}
475-
{{- range $topologySpreadConstraint := .Values.controller.topologySpreadConstraints -}}
476-
{{- if hasKey $topologySpreadConstraint "labelSelector" -}}
477-
{{- $topologySpreadConstraint | list | toYaml -}}
478-
{{- else -}}
479-
{{- merge $topologySpreadConstraint $defaultLabelSelector | list | toYaml -}}
480-
{{- end -}}
474+
{{- $default := dict "labelSelector" (dict "matchLabels" (include "vso.chart.selectorLabels" . | fromYaml)) -}}
475+
{{- $out := list -}}
476+
{{- range $c := .Values.controller.topologySpreadConstraints -}}
477+
{{- if hasKey $c "labelSelector" -}}
478+
{{- $out = append $out $c -}}
479+
{{- else -}}
480+
{{- $out = append $out (merge $c $default) -}}
481+
{{- end -}}
481482
{{- end -}}
483+
{{- toYaml $out -}}
482484
{{- end -}}

0 commit comments

Comments
 (0)