-
Notifications
You must be signed in to change notification settings - Fork 152
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
Migrate to aws-sdk-go-v2
#167
base: aws-sdk-go-v2
Are you sure you want to change the base?
Migrate to aws-sdk-go-v2
#167
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: michaelhtm 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 |
d260bd8
to
3f63416
Compare
pkg/runtime/config.go
Outdated
|
||
if roleARN != "" { | ||
client := sts.NewFromConfig(awsCfg) | ||
awsCfg.Credentials = stscreds.NewAssumeRoleProvider(client, string(roleARN)) |
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.
You will want to make sure to wrap this with a credentials cache, otherwise this will end up making an STS assume-role API call every time another API is called.
See example in sdk docs: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/credentials/stscreds#hdr-Assume_Role
pkg/runtime/config.go
Outdated
}), | ||
) | ||
|
||
awsCfg.AppID = val |
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.
This further changes the user agent header, but you're already fully setting a custom user agent with the middleware above, so this shouldn't be necessary
pkg/runtime/config.go
Outdated
|
||
func (c *serviceController) getHandlerValue(groupVersionKind schema.GroupVersionKind) string { | ||
|
||
val := fmt.Sprintf("%s/%s (%s) (%s) (%s) (%s)", |
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.
I don't believe this is generating the same user-agent string as before. See the logic to generate this string that was being used before: https://github.com/aws/aws-sdk-go/blob/7112c0a0c2d01713a9db2d57f0e5722225baf5b5/aws/request/handlers.go#L307-L316
3f63416
to
ab9ff3e
Compare
ab9ff3e
to
ba45c94
Compare
@michaelhtm: The following tests failed, say
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. |
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.