Skip to content

Commit

Permalink
feat(addon): Add support for PodIdentityAssociations
Browse files Browse the repository at this point in the history
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 1/ extracting ServiceAccounts/RoleARNs from a given PIA
  association ID 2/ 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
  • Loading branch information
a-hilaly committed Jul 12, 2024
1 parent 78062e2 commit 714bbbb
Show file tree
Hide file tree
Showing 34 changed files with 1,086 additions and 244 deletions.
12 changes: 6 additions & 6 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2024-06-06T04:13:17Z"
build_date: "2024-07-11T06:06:45Z"
build_hash: 14cef51778d471698018b6c38b604181a6948248
go_version: go1.21.1
version: v0.34.0
api_directory_checksum: 626700f8799840e0470b1ff7ef3dbb32665b9f9d
go_version: go1.22.4
version: v0.34.0-dirty
api_directory_checksum: 73d241a2b0ffedc502d04e12db2ca6a223dc09e8
api_version: v1alpha1
aws_sdk_go_version: v1.49.13
aws_sdk_go_version: v1.54.1
generator_config_info:
file_checksum: c6dada6a685b8ed90112dab66773cc94314dd2b8
file_checksum: 1d75859f086015d8a5dd3fce54480cd449524e66
original_file_name: generator.yaml
last_modification:
reason: API generation
7 changes: 7 additions & 0 deletions apis/v1alpha1/addon.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions apis/v1alpha1/cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 40 additions & 33 deletions apis/v1alpha1/enums.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,18 @@ operations:
resources:
Addon:
hooks:
delta_pre_compare:
code: customPreCompare(delta, a, b)
sdk_read_one_post_set_output:
template_path: hooks/addons/sdk_read_one_post_set_output.go.tpl
sdk_create_post_set_output:
template_path: hooks/addons/sdk_create_post_set_output.go.tpl
sdk_update_pre_build_request:
template_path: hooks/addons/sdk_update_pre_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/addons/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/addons/sdk_update_post_set_output.go.tpl
fields:
ClusterName:
references:
Expand All @@ -26,6 +36,29 @@ resources:
service_name: iam
resource: Role
path: Status.ACKResourceMetadata.ARN
PodIdentityAssociations:
set:
- ignore: true
method: Create
- ignore: true
method: ReadOne
compare:
is_ignored: true
# Note(a-hilaly): Ideally, we would like to have the following configuration
# but the generator doesn't support such a unique case. PodIdentityAssociations
# Is already defined in the spec and leveraging set[*].ignore: true, which is
# influencing the set configurations for PodIdentityAssociationIDs.
# We need to extend the code-generator (and build better APIs).
#
# PodIdentityAssociationIDs:
# is_read_only: true
# custom_field:
# list_of: String
# set:
# - method: ReadOne
# from: PodIdentityAssociations
# - method: Create
# from: PodIdentityAssociations
renames:
operations:
CreateAddon:
Expand Down
35 changes: 19 additions & 16 deletions apis/v1alpha1/nodegroup.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions apis/v1alpha1/pod_identity_association.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 714bbbb

Please sign in to comment.