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

Only set :endpoint from legacy option if present (AwsSdkAdapter) #390

Merged
merged 3 commits into from
Jan 19, 2022

Conversation

kjvarga
Copy link
Owner

@kjvarga kjvarga commented Jan 19, 2022

#389 extended. I didn't have permissions to push to the remote branch.

zokioki and others added 3 commits January 17, 2022 22:52
In the `aws-sdk-core` gem, the `endpoint` option is meant for
overriding the default endpoint value resolved from the region
option [1]. Passing a `nil` value for the endpoint option is
not the same as not passing it at all, as nil is still considered
to be an override [2][3].

A recent refactor to the `AwsSdkAdapter` looks to have tweaked the
options logic to always include the `endpoint` key in the object
being passed to `Aws::S3::Resource`. By default, this will raise
a "missing required option :endpoint" exception as the default
legacy option of `nil` will be set for the endpoint.

This change ensures that the `endpoint` value isn't set if
the legacy option is not specified.

[1] https://github.com/aws/aws-sdk-ruby/blob/c97f6932b6d5d6bc3e45aaf1068be52afd6781be/gems/aws-sdk-core/lib/seahorse/client/plugins/endpoint.rb#L11-L15
[2] https://github.com/aws/aws-sdk-ruby/blob/c97f6932b6d5d6bc3e45aaf1068be52afd6781be/gems/aws-sdk-core/lib/seahorse/client/plugins/endpoint.rb#L29-L32
[3] aws/aws-sdk-ruby#2066
…ve a value, and only if it is not already set
Copy link
Owner Author

@kjvarga kjvarga left a comment

Choose a reason for hiding this comment

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

LGTM

@kjvarga kjvarga merged commit aa69709 into master Jan 19, 2022
@kjvarga kjvarga deleted the zokioki/fix-s3-config-object branch January 19, 2022 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants