fix: unable to set controller/webhook replicas to zero (#2147)
Signed-off-by: Yi Chen <github@chenyicn.net>
This commit is contained in:
parent
bca6aa85cc
commit
1afa72e7a0
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue