Skip to content

Commit 40bb2e3

Browse files
authored
Fix incorrect field names in nodeResources example files (#1917)
The nodeResources filter examples incorrectly used `allocatableMemory` instead of `memoryAllocatable`. This causes YAML parsing to silently ignore the field, resulting in empty filter values and unexpected analyzer behavior. Changed in 3 files (5 instances total): - examples/preflight/node-resources.yaml (3 instances) - examples/preflight/e2e.yaml (1 instance) - examples/support-bundle/e2e.yaml (1 instance) The correct field names according to pkg/apis/troubleshoot/v1beta2/analyzer_shared.go are: - memoryAllocatable (not allocatableMemory) - cpuAllocatable (not allocatableCPU) - memoryCapacity (not capacityMemory) - cpuCapacity (not capacityCPU) This bug caused users copying from these examples to experience false failures in preflight checks, as documented in the bug report where a GKE cluster with 85Gi memory failed a check requiring only 8Gi.
1 parent cf2db49 commit 40bb2e3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/preflight/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ spec:
9292
- nodeResources:
9393
checkName: Must have 1 node with 2Gi (available) memory and at least 2 cores (on a single node)
9494
filters:
95-
allocatableMemory: 2Gi
95+
memoryAllocatable: 2Gi
9696
cpuCapacity: "2"
9797
outcomes:
9898
- pass:

examples/preflight/node-resources.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
- nodeResources:
2929
checkName: Must have 1 node with 16 GB (available) memory and 10 cores (on a single node)
3030
filters:
31-
allocatableMemory: 16Gi
31+
memoryAllocatable: 16Gi
3232
cpuCapacity: "10"
3333
outcomes:
3434
- fail:
@@ -39,7 +39,7 @@ spec:
3939
- nodeResources:
4040
checkName: Must have 1 node with 16 GB (available) memory and 4 cores of amd64 arch (on a single node)
4141
filters:
42-
allocatableMemory: 16Gi
42+
memoryAllocatable: 16Gi
4343
cpuArchitecture: amd64
4444
cpuCapacity: "4"
4545
outcomes:
@@ -54,7 +54,7 @@ spec:
5454
selector:
5555
matchLabel:
5656
node-role.kubernetes.io/master: ""
57-
allocatableMemory: 16Gi
57+
memoryAllocatable: 16Gi
5858
cpuArchitecture: amd64
5959
cpuCapacity: "6"
6060
outcomes:

examples/support-bundle/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ spec:
7777
- nodeResources:
7878
checkName: Must have 1 node with 2Gi (available) memory and at least 2 cores (on a single node)
7979
filters:
80-
allocatableMemory: 2Gi
80+
memoryAllocatable: 2Gi
8181
cpuCapacity: "2"
8282
outcomes:
8383
- pass:

0 commit comments

Comments
 (0)