-
Notifications
You must be signed in to change notification settings - Fork 625
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
Added bucket-lookup-type field to s3 config #3788
base: main
Are you sure you want to change the base?
Conversation
c5bc5e8
to
ce5b13f
Compare
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.
Thank you for working on this ❤️
pkg/objstore/providers/s3/config.go
Outdated
@@ -108,6 +121,14 @@ func (cfg *Config) Validate() error { | |||
return errUnsupportedSignatureVersion | |||
} | |||
|
|||
if cfg.ForcePathStyle && cfg.BucketLookupType == VirtualHostedStyleLookup { |
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.
Nit: Might be slightly more failsafe, once there is another lookup type added (I hope not 😆 )
if cfg.ForcePathStyle && cfg.BucketLookupType == VirtualHostedStyleLookup { | |
if cfg.ForcePathStyle && cfg.BucketLookupType != AutoLookup && cfg.BucketLookupType != PathStyleLookup { |
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.
Nit: Might be slightly more failsafe, once there is another lookup type added (I hope not 😆 )
Fixed
@@ -39,8 +39,10 @@ func newS3Config(cfg Config) (s3.Config, error) { | |||
} | |||
|
|||
bucketLookupType := s3.AutoLookup | |||
if cfg.ForcePathStyle { | |||
if cfg.ForcePathStyle || cfg.BucketLookupType == PathStyleLookup { |
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 wonder if we also should add a deprecation log warning when ForcePath argument is used, so users can notice it and migrate to BucketLookupType
Wdyt?
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.
Yeah, that's a great idea. I have tried to add a warning on bucket client initialization. Maybe there is a better place for such logic?
Hi Pyroscope Team!
This pull request targets the issue.
There are a few details I would like to point out:
a warning if force-path is set to true, that this flag is deprecated and might be removed going forward
. Unfortunately, I haven't found an elegant solution to do that and just put a deprecation message to flag's usage. There are flagext package, but it is used to replace deprecated flag completely. Pflag library has deprecation feature, but you use plain flag library here.