Skip to content

Commit 28b66bb

Browse files
test(computeplane): forward an explicit zero and the int32 maximum of maxUnavailable
An explicit 0 is what overrides the pool chart's default of 1 for GPU pools, so it must reach the pool unchanged rather than be dropped as an empty value. The int32 maximum is the largest value the schema accepts and must be forwarded as is. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <[email protected]>
1 parent 525e416 commit 28b66bb

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

‎packages/extra/computeplane/tests/cluster_test.yaml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,44 @@ tests:
301301
path: spec.values.maxUnavailable
302302
value: 1
303303

304+
# An explicit 0 must reach the pool chart: there it overrides the 1 a GPU
305+
# pool gets by default, so dropping it as empty would change the strategy.
306+
- it: forwards an explicit maxUnavailable of 0 to the pool chart
307+
documentSelector:
308+
path: metadata.name
309+
value: kubernetes-nodes-computeplane-cluster-md0
310+
set:
311+
nodeGroups:
312+
md0:
313+
minReplicas: 1
314+
maxReplicas: 3
315+
instanceType: u1.large
316+
diskSize: 32Gi
317+
roles: ["ingress-nginx"]
318+
maxUnavailable: 0
319+
asserts:
320+
- equal:
321+
path: spec.values.maxUnavailable
322+
value: 0
323+
324+
- it: forwards the int32 maximum to the pool chart
325+
documentSelector:
326+
path: metadata.name
327+
value: kubernetes-nodes-computeplane-cluster-md0
328+
set:
329+
nodeGroups:
330+
md0:
331+
minReplicas: 1
332+
maxReplicas: 3
333+
instanceType: u1.large
334+
diskSize: 32Gi
335+
roles: ["ingress-nginx"]
336+
maxUnavailable: 2147483647
337+
asserts:
338+
- equal:
339+
path: spec.values.maxUnavailable
340+
value: 2147483647
341+
304342
- it: refuses a maxUnavailable above the int32 range CAPI decodes
305343
set:
306344
nodeGroups:

0 commit comments

Comments
 (0)