-
Notifications
You must be signed in to change notification settings - Fork 635
🐛 fix: backwards compatibility for AWS service endpoint resolution #5680
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
Conversation
In AWS SDKv1, each service exports a constant EndpointsID to look up the custom service endpoint, for example, see ref [0]. In AWS SDKv2, these contants are no longer available. Thus, for backwards compatibility, we copy those constants from the SDKv1 and map them to the corresponding ServiceID in SDK v2. Additionally, in AWS SDKv1, elb and elbv2 uses the same identifier (i.e. same EndpointsID), thus the same custom endpoint [1][2]. For backwards compatibility, if elbv2 endpoint is undefined, elbv2 endpoint resolver should fall back to elb endpoint if any. This also fixes the bug where CAPA does not recognize services that define its serviceID with more than 1 word due to the incorrect assumption [3]. References: [0] https://github.com/aws/aws-sdk-go/blob/070853e88d22854d2355c2543d0958a5f76ad407/service/resourcegroupstaggingapi/service.go#L33-L34 [1] https://github.com/aws/aws-sdk-go/blob/070853e88d22854d2355c2543d0958a5f76ad407/service/elbv2/service.go#L32-L33 [2] https://github.com/aws/aws-sdk-go/blob/070853e88d22854d2355c2543d0958a5f76ad407/service/elb/service.go#L32-L33 [2] https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/88cb4b92b1a76591623e9d5ef347bfdc22010622/pkg/cloud/endpoints/endpoints.go#L90-L94
Hi @tthvo. 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 Once the patch is verified, the new status will be reflected by the 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. |
Cc. @punkwalker |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM label has been added. Git tree hash: db425f99a2ecae7ffe35f04d4036734139e1fb76
|
/cherry-pick release-2.9 |
@damdo: once the present PR merges, I will cherry-pick it on top of In response to this:
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. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nrb 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 |
/unhold |
@damdo: new pull request created: #5682 In response to this:
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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
In AWS SDKv1, each service exports a constant
EndpointsID
to look up the custom service endpoint, for example, see ref [0]. In AWS SDKv2, these contants are no longer available. Thus, for backwards compatibility, we copy those constants from the SDKv1 and map them to the correspondingServiceID
in SDK v2.Additionally, in AWS SDKv1,
elb
andelbv2
uses the same identifier (i.e. same EndpointsID), thus the same custom endpoint [1] [2]. For backwards compatibility, ifelbv2
endpoint is undefined,elbv2
endpoint resolver should fall back toelb
endpoint if any.This also fixes the bug where CAPA does not recognize services that define its
serviceID
with more than 1 word due to the incorrect assumption endpoints.go#L90-L94). The services are: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 #5670
Special notes for your reviewer:
Checklist:
Release note: