Skip to content

Commit

Permalink
fix: unable to set controller/webhook replicas to zero (kubeflow#2147)
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Chen <github@chenyicn.net>
  • Loading branch information
ChenYi015 authored Aug 30, 2024
1 parent bca6aa8 commit 1afa72e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ metadata:
labels:
{{- include "spark-operator.controller.labels" . | nindent 4 }}
spec:
{{- with .Values.controller.replicas }}
replicas: {{ . }}
{{- end }}
replicas: {{ .Values.controller.replicas }}
selector:
matchLabels:
{{- include "spark-operator.controller.selectorLabels" . | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ metadata:
labels:
{{- include "spark-operator.webhook.labels" . | nindent 4 }}
spec:
{{- with .Values.webhook.replicas }}
replicas: {{ . }}
{{- end }}
replicas: {{ .Values.webhook.replicas }}
selector:
matchLabels:
{{- include "spark-operator.webhook.selectorLabels" . | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ tests:
path: spec.replicas
value: 10

- it: Should set replicas if `controller.replicas` is set
set:
controller:
replicas: 0
asserts:
- equal:
path: spec.replicas
value: 0

- it: Should add pod labels if `controller.labels` is set
set:
controller:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ tests:
path: spec.replicas
value: 10

- it: Should set replicas if `webhook.replicas` is set
set:
webhook:
replicas: 0
asserts:
- equal:
path: spec.replicas
value: 0

- it: Should add pod labels if `webhook.labels` is set
set:
webhook:
Expand Down

0 comments on commit 1afa72e

Please sign in to comment.