Skip to content

Commit d800149

Browse files
authored
feat: add DesiredSize to NodegroupStatus (#154)
This commit adds the DesiredSize field to the NodegroupStatus struct, allowing users to observe the desired size of node groups in AWS directly from the status. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 663939a commit d800149

File tree

9 files changed

+44
-11
lines changed

9 files changed

+44
-11
lines changed
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-04-04T04:43:23Z"
3-
build_hash: f5a9ac2db3296fac3aa18dacf282267b15229ad1
4-
go_version: go1.24.1
5-
version: v0.44.0-2-gf5a9ac2
6-
api_directory_checksum: 99ed3c67c10b10fb277bcbe40a10712ec9dd8595
2+
build_date: "2025-04-10T23:52:19Z"
3+
build_hash: 0909e7f0adb8ffe4120a8c20d5d58b991f2539e9
4+
go_version: go1.24.0
5+
version: v0.44.0-3-g0909e7f
6+
api_directory_checksum: e1284610b12e8a87dde6ba9c99a9025f5b76f6d2
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.36.3
99
generator_config_info:
10-
file_checksum: 4615b96497cd57742b072f9ab8ae025ac2da2ca0
10+
file_checksum: 0dd14fb110a3f5752e37da4d8bf5247180ed2057
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ resources:
308308
priority: 1
309309
Nodegroup:
310310
fields:
311+
DesiredSize:
312+
is_read_only: true
313+
type: int
314+
# ideally, this should work. We do not need to create a new file
315+
# dedicated to documentation.
316+
documentation: "DesiredSize is the observed desired size of the node group in AWS."
311317
ClusterName:
312318
references:
313319
resource: Cluster
@@ -415,7 +421,7 @@ resources:
415421
index: 40
416422
priority: 1
417423
- name: DESIREDSIZE
418-
json_path: .spec.scalingConfig.desiredSize
424+
json_path: .status.desiredSize
419425
type: integer
420426
index: 50
421427
- name: MINSIZE

apis/v1alpha1/nodegroup.go

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/zz_generated.deepcopy.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/eks.services.k8s.aws_nodegroups.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
name: RELEASEVERSION
2929
priority: 1
3030
type: string
31-
- jsonPath: .spec.scalingConfig.desiredSize
31+
- jsonPath: .status.desiredSize
3232
name: DESIREDSIZE
3333
type: integer
3434
- jsonPath: .spec.scalingConfig.minSize
@@ -441,6 +441,9 @@ spec:
441441
description: The Unix epoch timestamp at object creation.
442442
format: date-time
443443
type: string
444+
desiredSize:
445+
format: int64
446+
type: integer
444447
health:
445448
description: |-
446449
The health status of the node group. If there are issues with your node group's

generator.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ resources:
308308
priority: 1
309309
Nodegroup:
310310
fields:
311+
DesiredSize:
312+
is_read_only: true
313+
type: int
314+
# ideally, this should work. We do not need to create a new file
315+
# dedicated to documentation.
316+
documentation: "DesiredSize is the observed desired size of the node group in AWS."
311317
ClusterName:
312318
references:
313319
resource: Cluster
@@ -415,7 +421,7 @@ resources:
415421
index: 40
416422
priority: 1
417423
- name: DESIREDSIZE
418-
json_path: .spec.scalingConfig.desiredSize
424+
json_path: .status.desiredSize
419425
type: integer
420426
index: 50
421427
- name: MINSIZE

helm/crds/eks.services.k8s.aws_nodegroups.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
name: RELEASEVERSION
2929
priority: 1
3030
type: string
31-
- jsonPath: .spec.scalingConfig.desiredSize
31+
- jsonPath: .status.desiredSize
3232
name: DESIREDSIZE
3333
type: integer
3434
- jsonPath: .spec.scalingConfig.minSize
@@ -441,6 +441,9 @@ spec:
441441
description: The Unix epoch timestamp at object creation.
442442
format: date-time
443443
type: string
444+
desiredSize:
445+
format: int64
446+
type: integer
444447
health:
445448
description: |-
446449
The health status of the node group. If there are issues with your node group's

pkg/resource/nodegroup/sdk.go

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/hooks/nodegroup/sdk_read_one_post_set_output.go.tpl

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if ko.Spec.ScalingConfig != nil && ko.Spec.ScalingConfig.DesiredSize != nil {
2+
ko.Status.DesiredSize = ko.Spec.ScalingConfig.DesiredSize
3+
}
4+
15
if !nodegroupActive(&resource{ko}) {
26
// Setting resource synced condition to false will trigger a requeue of
37
// the resource. No need to return a requeue error here.

0 commit comments

Comments
 (0)