-
Notifications
You must be signed in to change notification settings - Fork 820
Make s3 bucket lookup type configurable #4794
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
Make s3 bucket lookup type configurable #4794
Conversation
bf3bf0a
to
a580215
Compare
a580215
to
c0c6a99
Compare
c0c6a99
to
ff4a96c
Compare
@damnever could you fix the lint? |
02bcfa0
to
d236e40
Compare
@danielblando done |
pkg/storage/bucket/s3/config.go
Outdated
@@ -95,6 +106,19 @@ func (cfg *Config) Validate() error { | |||
return nil | |||
} | |||
|
|||
func (cfg *Config) bucketLookupType() s3.BucketLookupType { |
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.
What is your opinion on doing this the same as "BuildThanosConfig()"?
Returning an error when it goes to default which can also return the AutoLookup. The caller can decide what to do. I think at least we are not swallowing any issues.
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.
What is your opinion on doing this the same as "BuildThanosConfig()"?
We need to convert our string type into s3.BucketLookupType.
Returning an error when it goes to default which can also return the AutoLookup. The caller can decide what to do. I think at least we are not swallowing any issues.
I think Validate
is sufficient for our case. However, returning an error is better for other use.
d236e40
to
6a476f8
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.
Nice, thanks
Seems there are some tests failing now. |
Signed-off-by: Xiaochao Dong (@damnever) <the.xcdong@gmail.com>
61cb1f4
to
4028435
Compare
Signed-off-by: Xiaochao Dong (@damnever) <the.xcdong@gmail.com>
4028435
to
5213bb5
Compare
LGTM, thanks for the contribution! |
What this PR does:
Which issue(s) this PR fixes:
Some providers may only support one of those bucket lookup styles.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]