Merge pull request #7139 from ParichayDidwania/pdb-minavailable-precedence

fix(helm): Allow pdb minAvailable to take precedence over default max…
This commit is contained in:
Kubernetes Prow Robot 2025-03-13 16:13:46 -07:00 committed by GitHub
commit 0a9528b202
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,7 @@
{{- if .Values.podDisruptionBudget -}} {{- if .Values.podDisruptionBudget -}}
apiVersion: {{ template "podDisruptionBudget.apiVersion" . }} {{- if and .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable }}
{{- fail "Only one of podDisruptionBudget.minAvailable or podDisruptionBudget.maxUnavailable should be set." }}
{{- end }}apiVersion: {{ template "podDisruptionBudget.apiVersion" . }}
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
labels: labels:
@ -10,7 +12,10 @@ spec:
selector: selector:
matchLabels: matchLabels:
{{ include "cluster-autoscaler.instance-name" . | indent 6 }} {{ include "cluster-autoscaler.instance-name" . | indent 6 }}
{{- if .Values.podDisruptionBudget }} {{- if and .Values.podDisruptionBudget.minAvailable (not .Values.podDisruptionBudget.maxUnavailable) }}
{{ toYaml .Values.podDisruptionBudget | nindent 2 }} minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }} {{- end }}
{{- if and .Values.podDisruptionBudget.maxUnavailable (not .Values.podDisruptionBudget.minAvailable) }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
{{- end -}} {{- end -}}