fix: unable to set controller/webhook replicas to zero (#2147)

Signed-off-by: Yi Chen <github@chenyicn.net>
This commit is contained in:
Yi Chen 2024-08-30 22:26:05 +08:00 committed by GitHub
parent bca6aa85cc
commit 1afa72e7a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 6 deletions

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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:

View File

@ -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: