Skip to content

Commit 27651cb

Browse files
committed
Fix support for falsy values
1 parent dd6b6ea commit 27651cb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

charts/buildkit-operator/templates/poddisruptionbudget.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ metadata:
1010
control-plane: controller-manager
1111
{{- include "buildkit-operator.labels" . | nindent 4 }}
1212
spec:
13-
{{- if and .Values.podDisruptionBudget.minAvailable (not (hasKey .Values.podDisruptionBudget "maxUnavailable")) }}
14-
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
15-
{{- else if .Values.podDisruptionBudget.maxUnavailable }}
13+
{{- if hasKey .Values.podDisruptionBudget "maxUnavailable" }}
1614
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
15+
{{- else if hasKey .Values.podDisruptionBudget "minAvailable" }}
16+
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
17+
{{- else }}
18+
# Default to minAvailable: 1 if neither is specified
19+
minAvailable: 1
1720
{{- end }}
1821
selector:
1922
matchLabels:

0 commit comments

Comments
 (0)