Skip to content

Commit 0a9528b

Browse files
authored
Merge pull request #7139 from ParichayDidwania/pdb-minavailable-precedence
fix(helm): Allow pdb minAvailable to take precedence over default max…
2 parents 0d35a21 + b806889 commit 0a9528b

File tree

1 file changed

+9
-4
lines changed
  • charts/cluster-autoscaler/templates

1 file changed

+9
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{{- if .Values.podDisruptionBudget -}}
2-
apiVersion: {{ template "podDisruptionBudget.apiVersion" . }}
2+
{{- if and .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable }}
3+
{{- fail "Only one of podDisruptionBudget.minAvailable or podDisruptionBudget.maxUnavailable should be set." }}
4+
{{- end }}apiVersion: {{ template "podDisruptionBudget.apiVersion" . }}
35
kind: PodDisruptionBudget
46
metadata:
57
labels:
@@ -10,7 +12,10 @@ spec:
1012
selector:
1113
matchLabels:
1214
{{ include "cluster-autoscaler.instance-name" . | indent 6 }}
13-
{{- if .Values.podDisruptionBudget }}
14-
{{ toYaml .Values.podDisruptionBudget | nindent 2 }}
15-
{{- end }}
15+
{{- if and .Values.podDisruptionBudget.minAvailable (not .Values.podDisruptionBudget.maxUnavailable) }}
16+
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
17+
{{- end }}
18+
{{- if and .Values.podDisruptionBudget.maxUnavailable (not .Values.podDisruptionBudget.minAvailable) }}
19+
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
20+
{{- end }}
1621
{{- end -}}

0 commit comments

Comments
 (0)