-
Notifications
You must be signed in to change notification settings - Fork 837
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
Object Store (AWS): Support dynamically resolving S3 bucket region #4188
Conversation
Really nice find that it returns the header even on permission error 👍 Given this doesn't use anything on the builder, what do you think about making this a free function that takes a bucket name and &ClientOptions and returns the region? This would keep the builder signature slightly more consistent? Maybe something like |
@tustvold I like that suggestion. Implemented as I'd like your feedback on the tests too... They hit the S3 HeadBucket API using some bucket names that work today, but that might not be true forever (someone could create a bucket named "please-dont-exist"). This was to show it working in PR, but maybe better to convert to unit tests by creating a private |
I think this is fine, we can always update the tests should this change. I don't think it is worth the added complexity to mock it out, you would end up with more test logic than actual logic 😆 |
I took the liberty of pushing 5c5fc07 to clean the error handling up a little, prior to getting this in |
Thank you for working on this |
Which issue does this PR close?
Closes #3213.
Rationale for this change
See #3213.
What changes are included in this PR?
Are there any user-facing changes?
Added a new
aws::resolve_bucket_region
function that uses the HeadBucket API to get the bucket region.