Skip to content

Commit 16d0936

Browse files
authored
feat(addon): Add support for PodIdentityAssociations (#120)
This commit introduces support for `PodIdentityAssociations` in Addons CRD, enhancing the controller's capabilities to manage PIAs directly through the Addon resources. Key changes: - Bump the sdk to v1.54.1 to bring the latest API schema changes - Introduce `PodIdentityAssociations` to the addons spec - Add custom logic for: - extracting `ServiceAccounts`/`RoleARNs` from a given PIA association ID - properly comparing two arrays of PIAs - Enhanced Addon status checks and requeue logic to ensure proper synchronization - Add some unit tests and e2e tests for Addon.PIAs By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent b6f5ba5 commit 16d0936

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1159
-723
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2024-10-01T19:56:53Z"
3-
build_hash: f8f98563404066ac3340db0a049d2e530e5c51cc
4-
go_version: go1.23.0
5-
version: v0.38.1
6-
api_directory_checksum: 626700f8799840e0470b1ff7ef3dbb32665b9f9d
2+
build_date: "2024-10-02T18:08:39Z"
3+
build_hash: 9b58156c4d3482ef5175d763efea10e9a4197b69
4+
go_version: go1.22.4
5+
version: v0.38.1-2-g9b58156
6+
api_directory_checksum: d736919240d3843865e860f7cb685cec30921bd4
77
api_version: v1alpha1
8-
aws_sdk_go_version: v1.49.13
8+
aws_sdk_go_version: v1.54.1
99
generator_config_info:
10-
file_checksum: c6dada6a685b8ed90112dab66773cc94314dd2b8
10+
file_checksum: 1d75859f086015d8a5dd3fce54480cd449524e66
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/addon.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/cluster.go

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/enums.go

Lines changed: 40 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/generator.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ operations:
1414
resources:
1515
Addon:
1616
hooks:
17+
delta_pre_compare:
18+
code: customPreCompare(delta, a, b)
19+
sdk_read_one_post_set_output:
20+
template_path: hooks/addons/sdk_read_one_post_set_output.go.tpl
21+
sdk_create_post_set_output:
22+
template_path: hooks/addons/sdk_create_post_set_output.go.tpl
1723
sdk_update_pre_build_request:
1824
template_path: hooks/addons/sdk_update_pre_build_request.go.tpl
25+
sdk_update_post_build_request:
26+
template_path: hooks/addons/sdk_update_post_build_request.go.tpl
27+
sdk_update_post_set_output:
28+
template_path: hooks/addons/sdk_update_post_set_output.go.tpl
1929
fields:
2030
ClusterName:
2131
references:
@@ -26,6 +36,29 @@ resources:
2636
service_name: iam
2737
resource: Role
2838
path: Status.ACKResourceMetadata.ARN
39+
PodIdentityAssociations:
40+
set:
41+
- ignore: true
42+
method: Create
43+
- ignore: true
44+
method: ReadOne
45+
compare:
46+
is_ignored: true
47+
# Note(a-hilaly): Ideally, we would like to have the following configuration
48+
# but the generator doesn't support such a unique case. PodIdentityAssociations
49+
# Is already defined in the spec and leveraging set[*].ignore: true, which is
50+
# influencing the set configurations for PodIdentityAssociationIDs.
51+
# We need to extend the code-generator (and build better APIs).
52+
#
53+
# PodIdentityAssociationIDs:
54+
# is_read_only: true
55+
# custom_field:
56+
# list_of: String
57+
# set:
58+
# - method: ReadOne
59+
# from: PodIdentityAssociations
60+
# - method: Create
61+
# from: PodIdentityAssociations
2962
renames:
3063
operations:
3164
CreateAddon:

apis/v1alpha1/nodegroup.go

Lines changed: 19 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/pod_identity_association.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)