Skip to content

feat(config,cache/s3proxy): add s3 addressing style support#662

Closed
wuhuizuo wants to merge 3 commits intobuchgr:masterfrom
wuhuizuo:feature/s3-proxy-addressing-style-support
Closed

feat(config,cache/s3proxy): add s3 addressing style support#662
wuhuizuo wants to merge 3 commits intobuchgr:masterfrom
wuhuizuo:feature/s3-proxy-addressing-style-support

Conversation

@wuhuizuo
Copy link
Copy Markdown
Contributor

@wuhuizuo wuhuizuo commented May 24, 2023

Some S3 providers do not support auto bucket lookup type, need to set it with path type or dns type.

Here I added a support to set it in s3_proxy filed in configuration to make it reachable.

@wuhuizuo wuhuizuo force-pushed the feature/s3-proxy-addressing-style-support branch from 6202029 to 8c78612 Compare May 24, 2023 12:25
@wuhuizuo wuhuizuo closed this May 25, 2023
@wuhuizuo wuhuizuo reopened this May 25, 2023
@wuhuizuo
Copy link
Copy Markdown
Contributor Author

/reopen to rerun the golang ci lint job

Copy link
Copy Markdown
Collaborator

@mostynb mostynb left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. Sorry it took me a few days to look at this.

@wuhuizuo
Copy link
Copy Markdown
Contributor Author

wuhuizuo commented Jun 3, 2023

Thanks for the contribution. Sorry it took me a few days to look at this.

I fixed it.

Copy link
Copy Markdown
Collaborator

@mostynb mostynb left a comment

Choose a reason for hiding this comment

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

This feature looks good to me, but I think we should use string flags instead, for improved readability.

I had to do some background reading to understand the use case. This blog post was useful, sharing it here for anyone reading through this PR later: https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/

@wuhuizuo wuhuizuo force-pushed the feature/s3-proxy-addressing-style-support branch from c743668 to 5fbf4c4 Compare June 18, 2023 07:42
@wuhuizuo wuhuizuo force-pushed the feature/s3-proxy-addressing-style-support branch from 5fbf4c4 to 67dbda2 Compare June 18, 2023 07:45
@wuhuizuo wuhuizuo requested a review from mostynb June 18, 2023 07:45
config/proxy.go Outdated
Comment on lines +91 to +92
// also when not found the type, return "auto" type.
return valMap[typeStr]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this function should probably check if typeStr is in the map, and return an error if it isn't. And this error checking should be done in validateConfig() in config/config.go

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we only need to check it in validateConfig().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also I refactored it again.

@wuhuizuo wuhuizuo force-pushed the feature/s3-proxy-addressing-style-support branch from 49bc4de to dff949c Compare June 20, 2023 10:59
@mostynb
Copy link
Copy Markdown
Collaborator

mostynb commented Jun 20, 2023

Thanks for following through with these changes- I made a few minor tweaks and landed this on the master branch.

@mostynb mostynb closed this Jun 20, 2023
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