Skip to content

Commit 1afa72e

Browse files
authored
fix: unable to set controller/webhook replicas to zero (#2147)
Signed-off-by: Yi Chen <github@chenyicn.net>
1 parent bca6aa8 commit 1afa72e

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

charts/spark-operator-chart/templates/controller/deployment.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ metadata:
2121
labels:
2222
{{- include "spark-operator.controller.labels" . | nindent 4 }}
2323
spec:
24-
{{- with .Values.controller.replicas }}
25-
replicas: {{ . }}
26-
{{- end }}
24+
replicas: {{ .Values.controller.replicas }}
2725
selector:
2826
matchLabels:
2927
{{- include "spark-operator.controller.selectorLabels" . | nindent 6 }}

charts/spark-operator-chart/templates/webhook/deployment.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ metadata:
2222
labels:
2323
{{- include "spark-operator.webhook.labels" . | nindent 4 }}
2424
spec:
25-
{{- with .Values.webhook.replicas }}
26-
replicas: {{ . }}
27-
{{- end }}
25+
replicas: {{ .Values.webhook.replicas }}
2826
selector:
2927
matchLabels:
3028
{{- include "spark-operator.webhook.selectorLabels" . | nindent 6 }}

charts/spark-operator-chart/tests/controller/deployment_test.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ tests:
5353
path: spec.replicas
5454
value: 10
5555

56+
- it: Should set replicas if `controller.replicas` is set
57+
set:
58+
controller:
59+
replicas: 0
60+
asserts:
61+
- equal:
62+
path: spec.replicas
63+
value: 0
64+
5665
- it: Should add pod labels if `controller.labels` is set
5766
set:
5867
controller:

charts/spark-operator-chart/tests/webhook/deployment_test.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ tests:
4848
path: spec.replicas
4949
value: 10
5050

51+
- it: Should set replicas if `webhook.replicas` is set
52+
set:
53+
webhook:
54+
replicas: 0
55+
asserts:
56+
- equal:
57+
path: spec.replicas
58+
value: 0
59+
5160
- it: Should add pod labels if `webhook.labels` is set
5261
set:
5362
webhook:

0 commit comments

Comments
 (0)