Skip to content

✨ Migrate ec2 to AWS SDK V2 #5521

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yiannistri
Copy link

@yiannistri yiannistri commented Jun 4, 2025

What type of PR is this?

/kind feature
/kind cleanup

What this PR does / why we need it:

  • Migrates ec2 packages to AWS SDK v2.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #5403, #5411

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • includes emoji in title
  • adds unit tests
  • adds or updates e2e tests

Release note:

Migrate EC2 packages to AWS SDK v2

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jun 4, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ankitasw for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Jun 4, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @yiannistri!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 4, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @yiannistri. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@yiannistri yiannistri force-pushed the ec2-sdk-v2-migration branch 16 times, most recently from 52a7c2f to 543a41c Compare June 5, 2025 12:15
@alexander-demicev
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 2, 2025
@yiannistri yiannistri force-pushed the ec2-sdk-v2-migration branch from f7de9ec to cc17ae5 Compare July 2, 2025 07:18
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 3, 2025
@yiannistri yiannistri force-pushed the ec2-sdk-v2-migration branch from cc17ae5 to e4897d8 Compare July 7, 2025 16:11
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 7, 2025
@yiannistri yiannistri force-pushed the ec2-sdk-v2-migration branch from e4897d8 to 182a570 Compare July 8, 2025 06:52
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2025
@yiannistri yiannistri force-pushed the ec2-sdk-v2-migration branch 3 times, most recently from e9a8513 to 969ef40 Compare July 8, 2025 08:49
@damdo
Copy link
Member

damdo commented Jul 16, 2025

@yiannistri hey would you be able to rebate now that the GC or merged? Thanks!

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 16, 2025
@yiannistri yiannistri force-pushed the ec2-sdk-v2-migration branch from 969ef40 to d41bfa1 Compare July 18, 2025 12:43
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 18, 2025
@yiannistri yiannistri force-pushed the ec2-sdk-v2-migration branch 3 times, most recently from 5cbd613 to bbfc145 Compare July 18, 2025 14:49
@damdo
Copy link
Member

damdo commented Jul 18, 2025

/test pull-cluster-api-provider-aws-e2e-eks pull-cluster-api-provider-aws-e2e

@damdo damdo requested review from punkwalker and nrb July 18, 2025 16:17
Copy link
Contributor

@punkwalker punkwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yiannistri This is the biggest of V2 migration. Thank you for working on this. I have requested few changes, otherwise this LGTM.

})
}
}
}

if len(inputFilters) > 0 {
out, err := s.EC2Client.DescribeSubnetsWithContext(context.TODO(), &ec2.DescribeSubnetsInput{
out, err := s.EC2Client.DescribeSubnets(context.TODO(), &ec2.DescribeSubnetsInput{
Copy link
Contributor

@punkwalker punkwalker Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we bring the context from parent calls here instead of using context.TODO()? Similarly, should we do it for all such EC2Client. i.e, if context is available in parent method, use it instead of TODO?

P.S. I know the context.TODO() has been around but thought of improving it while we are at it :)

@yiannistri yiannistri force-pushed the ec2-sdk-v2-migration branch from bbfc145 to acdf352 Compare July 21, 2025 06:56
@damdo
Copy link
Member

damdo commented Jul 21, 2025

/test pull-cluster-api-provider-aws-e2e-eks pull-cluster-api-provider-aws-e2e

2 similar comments
@damdo
Copy link
Member

damdo commented Jul 21, 2025

/test pull-cluster-api-provider-aws-e2e-eks pull-cluster-api-provider-aws-e2e

@damdo
Copy link
Member

damdo commented Jul 21, 2025

/test pull-cluster-api-provider-aws-e2e-eks pull-cluster-api-provider-aws-e2e

@k8s-ci-robot
Copy link
Contributor

@yiannistri: 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
pull-cluster-api-provider-aws-e2e acdf352 link false /test pull-cluster-api-provider-aws-e2e
pull-cluster-api-provider-aws-e2e-eks acdf352 link false /test pull-cluster-api-provider-aws-e2e-eks

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate ec2 code to AWS SDK v2
7 participants