Skip to content
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

Switch to aws-sdk-go-v2 #120

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mjlshen
Copy link
Contributor

@mjlshen mjlshen commented Oct 8, 2024

This PR switches the codebase from aws-sdk-go to aws-sdk-go-v2 due to aws-sdk-go going EoL next year https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/

For the most part, it is faithful to the original code, some differences to highlight:

Fixes #117

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 8, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mjlshen
Once this PR has been reviewed and has the lgtm label, please assign nckturner for approval. For more information see the Kubernetes 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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 8, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to keep this code as similar to the original version as possible, but there are two considerations I ran into that I'm happy to implement if reviewers think they're better

  1. It may make more sense to use errors.As to filter errors instead of switching on the error code https://aws.github.io/aws-sdk-go-v2/docs/handling-errors/#api-error-responses
  2. The smithy.APIError type has an ErrorFault method that classifies certain errors as client/server/unknown faults https://pkg.go.dev/github.com/aws/smithy-go#ErrorFault. This could be used instead of maintaining our own list of client-fault error codes.

* We have been pinning to older versions of many golangci-lint packages
  that are no longer needed
* Updated golangci-lint to v1.61.0 and change a deprecated --deadline
  flag to --timeout
* Resolve linter errors

Signed-off-by: Michael Shen <[email protected]>
grpc.Dial and grpc.DialWithContext were deprecated and mention their
replacement as grpc.NewClient. https://pkg.go.dev/google.golang.org/[email protected]#Dial

One consequence of this change is that the target address needs to have
"unix:" or "unix://" prepended to the absolute path for NewClient to
create a connection properly.

Signed-off-by: Michael Shen <[email protected]>
It was providing a client-side rate limiter that is now built-in
functionality in aws-sdk-go-v2

Signed-off-by: Michael Shen <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 13, 2024
@mjlshen
Copy link
Contributor Author

mjlshen commented Nov 13, 2024

I added b9333f0 and a7a91e5 to this PR just to show that CI will pass with them included (otherwise, CI fails due to linting errors). The same two commits are also split out into a separate PR in #122 to help make this PR smaller and more easily reviewable.

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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

switch to aws-sdk-go-v2 as v1 is going away
2 participants