-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: fix for https://github.com/aws/aws-sdk-go/issues/452 #4024
Conversation
aa84e24
to
efaaa0a
Compare
) | ||
|
||
var defaultClient = ec2metadata.New(session.New(aws.NewConfig())) |
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.
The additional aws.NewConfig()
is not required when creating a new session. You could do just, ec2metadata.New(session.New())
. The config parameter New
takes is an optional variadic list of configs which will be merged on top of the session's copy of the default config sourced from the SDK's defaults
package.
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.
Done 👍
efaaa0a
to
71262c5
Compare
) | ||
|
||
var defaultClient = ec2metadata.New(session.New()) |
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.
Is there any reason for this to be defined here rather than as part of the allocation of ec2rolecreds.EC2RoleProvider
on line 49?
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.
Done. It was there to reuse single var.
Hi @rjeczalik! Thanks for submitting this - I agree the change looks correct as per aws/aws-sdk-go#452. I've left a few comments in line on the diffs, could you let me you know what you think? |
71262c5
to
9e66e18
Compare
@jen20 Addressed, please take a look. |
provider/aws: fix for aws/aws-sdk-go#452
Thanks @rjeczalik! I think this may address several crash reports, including #4036. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fixes nil deref panic caused by aws/aws-sdk-go#452.