Skip to content

Commit f252aad

Browse files
committed
Update kuberay operator Helm unit tests
Signed-off-by: Yi Chen <[email protected]>
1 parent f3602d4 commit f252aad

File tree

2 files changed

+94
-1
lines changed

2 files changed

+94
-1
lines changed

helm-chart/kuberay-operator/tests/deployment_test.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,99 @@ tests:
139139
seccompProfile:
140140
type: RuntimeDefault
141141

142+
- it: Should add feature gates to arguments if specified
143+
set:
144+
featureGates:
145+
- name: RayClusterStatusConditions
146+
enabled: true
147+
- name: RayJobDeletionPolicy
148+
enabled: false
149+
asserts:
150+
- contains:
151+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
152+
content: --feature-gates=RayClusterStatusConditions=true,RayJobDeletionPolicy=false
153+
154+
- it: Should enable batch scheduler if `batchScheduler.enabled` is set to `true`
155+
set:
156+
batchScheduler:
157+
enabled: true
158+
asserts:
159+
- contains:
160+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
161+
content: --enable-batch-scheduler
162+
163+
- it: Should use the specified batch scheduler name if `batchScheduler.name` is set
164+
set:
165+
batchScheduler:
166+
name: test-batch-scheduler
167+
asserts:
168+
- contains:
169+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
170+
content: --batch-scheduler=test-batch-scheduler
171+
172+
- it: Should watch the release namespace if `singleNamespaceInstall` is `true` and `watchNamespace` is empty
173+
set:
174+
singleNamespaceInstall: true
175+
watchNamespace: []
176+
asserts:
177+
- contains:
178+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
179+
content: --watch-namespace=kuberay-system
180+
181+
- it: Should watch the specified namespaces if `watchNamespace` is set
182+
set:
183+
watchNamespace:
184+
- ns1
185+
- ns2
186+
- ns3
187+
asserts:
188+
- contains:
189+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
190+
content: --watch-namespace=ns1,ns2,ns3
191+
192+
- it: Should use the specified logging stdout encoder if `stdoutEncoder` is set
193+
set:
194+
logging:
195+
stdoutEncoder: test-stdout-encoder
196+
asserts:
197+
- contains:
198+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
199+
content: --log-stdout-encoder=test-stdout-encoder
200+
201+
- it: Should use the specified logging file encoder if `stdoutEncoder` is set
202+
set:
203+
logging:
204+
fileEncoder: test-file-encoder
205+
asserts:
206+
- contains:
207+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
208+
content: --log-file-encoder=test-file-encoder
209+
210+
- it: Should use kubernetes proxy if `useKubernetesProxy` is set to `true`
211+
set:
212+
useKubernetesProxy: true
213+
asserts:
214+
- contains:
215+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
216+
content: --use-kubernetes-proxy=true
217+
218+
- it: Should enable leader election if `leaderElectionEnabled` is set to `true`
219+
set:
220+
leaderElectionEnabled: true
221+
asserts:
222+
- contains:
223+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
224+
content: --enable-leader-election=true
225+
226+
- it: Should enable metrics if `metrics.enabled` is set to `true`
227+
set:
228+
metrics:
229+
enabled: true
230+
asserts:
231+
- contains:
232+
path: spec.template.spec.containers[?(@.name=="kuberay-operator")].args
233+
content: --enable-metrics=true
234+
142235
- it: Should add environment variables if `env` is set
143236
set:
144237
env:

helm-chart/kuberay-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ crNamespacedRbacEnable: true
117117
singleNamespaceInstall: false
118118

119119
# -- The KubeRay operator will watch the custom resources in the namespaces listed in the "watchNamespace" parameter.
120-
watchNamespace:
120+
watchNamespace: []
121121
# - ns1
122122
# - ns2
123123

0 commit comments

Comments
 (0)