Skip to content

Migrate ACK to AWS SDK GO V2 #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Feb 5, 2025
Merged

Conversation

michaelhtm
Copy link
Member

Description of changes:
Since aws-sdk-go will no longer be maintained after 07/31/2024.
With this PR, we will be using the aws-sdk-go-v2 API models to generate
our controllers.
The changes are:

  • Introduced an apiv2 package that loads the V2 models into the API structure
  • Change how we set the resource and sdk, since most fields in V2 are now non-pointers
  • Add V2 model files for unit tests
  • Modify Unit test against these changes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from a-hilaly and jlbutler January 11, 2025 00:15
@michaelhtm michaelhtm changed the base branch from main to aws-sdk-go-v2 January 11, 2025 00:15
@michaelhtm michaelhtm force-pushed the backer branch 2 times, most recently from 0b0d80e to fde99b9 Compare January 23, 2025 22:48
@michaelhtm michaelhtm force-pushed the backer branch 2 times, most recently from 65286bf to 18b54d9 Compare January 31, 2025 19:37
michaelhtm and others added 15 commits February 4, 2025 13:55
…trollers-k8s#563)

Description of changes:
Since the aws-sdk-go repository will not be supported starting July 2025, 
we are moving it under our repository. Doing so will also make it easy to 
make any changes if needed, when we support aws-sdk-go-v2.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
The package loads the aws-sdk-v2 package into the V1 API struct, that is used throughout the code-generator

Co-Authored-By: Rohit Kurdukar - Amazon <[email protected]>
Also removing the V1 model and doc files for
* Change templates to import from right path
* Handle pointer/non pointer assignments
This is the draft before the final commit addressing some type conversion issues, secret reference issues
S3Control has shapes with members that have default value assigned, even though they are pointers. linked source from comment where aws-sdk-v2 repository removes those defaults to treat to ensure its generated/handled as a pointer
Since errors now have their own type, we will be generating a new way of verifying if a resource is not found by just checking if the type of error the find operation returns is the same type as the ResourceNotFoundException error for that operation
…tion details

Handling terminal errors and notFound errors differently.
In previous commit we were using the service defined exception structures.
This method does not work for controllers such as s3 and s3control. With more
tests, we will now be using the APIError type provided by aws/smithy-go. This interface is
implemented by all service errors so we will just compare to its ErrorCode() as we've done with V1.
Interface go types are marked as union types in the sdk model.
Handling the code-generation of this type with this commit, and adding unit tests for it as well.
This example was seen in ec2 model for VpcPeeringConnectionStateReasonCode
@michaelhtm michaelhtm changed the base branch from aws-sdk-go-v2 to main February 4, 2025 22:44
@michaelhtm
Copy link
Member Author

/retest

@michaelhtm
Copy link
Member Author

/retest

2 similar comments
@michaelhtm
Copy link
Member Author

/retest

@michaelhtm
Copy link
Member Author

/retest

Copy link

ack-prow bot commented Feb 5, 2025

@michaelhtm: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
verify-attribution 509a999 link false /test verify-attribution
s3-olm-test 509a999 link false /test s3-olm-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@rushmash91
Copy link
Member

Nice!
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2025
@a-hilaly
Copy link
Member

a-hilaly commented Feb 5, 2025

/lgtm

Copy link

ack-prow bot commented Feb 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, michaelhtm, rushmash91

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot added the approved label Feb 5, 2025
@ack-prow ack-prow bot merged commit 171d6a0 into aws-controllers-k8s:main Feb 5, 2025
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants