Skip to content

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

Merged
merged 2 commits into from
Sep 7, 2022

Conversation

damnever
Copy link
Contributor

@damnever damnever commented Jul 20, 2022

What this PR does:

Which issue(s) this PR fixes:
Some providers may only support one of those bucket lookup styles.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@damnever damnever force-pushed the feat/export-s3lookuptype branch from bf3bf0a to a580215 Compare July 20, 2022 13:59
@pull-request-size pull-request-size bot added size/M and removed size/S labels Jul 20, 2022
@damnever damnever force-pushed the feat/export-s3lookuptype branch from a580215 to c0c6a99 Compare July 20, 2022 14:00
@damnever damnever force-pushed the feat/export-s3lookuptype branch from c0c6a99 to ff4a96c Compare September 1, 2022 10:52
@danielblando
Copy link
Contributor

@damnever could you fix the lint?

@damnever damnever force-pushed the feat/export-s3lookuptype branch 2 times, most recently from 02bcfa0 to d236e40 Compare September 2, 2022 01:43
@damnever
Copy link
Contributor Author

damnever commented Sep 2, 2022

@danielblando done

@@ -95,6 +106,19 @@ func (cfg *Config) Validate() error {
return nil
}

func (cfg *Config) bucketLookupType() s3.BucketLookupType {
Copy link
Contributor

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.

Copy link
Contributor Author

@damnever damnever Sep 5, 2022

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.

@damnever damnever force-pushed the feat/export-s3lookuptype branch from d236e40 to 6a476f8 Compare September 5, 2022 12:33
Copy link
Contributor

@danielblando danielblando left a comment

Choose a reason for hiding this comment

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

Nice, thanks

@alanprot
Copy link
Member

alanprot commented Sep 6, 2022

Seems there are some tests failing now.

Signed-off-by: Xiaochao Dong (@damnever) <the.xcdong@gmail.com>
@damnever damnever force-pushed the feat/export-s3lookuptype branch from 61cb1f4 to 4028435 Compare September 7, 2022 03:40
Signed-off-by: Xiaochao Dong (@damnever) <the.xcdong@gmail.com>
@damnever damnever force-pushed the feat/export-s3lookuptype branch from 4028435 to 5213bb5 Compare September 7, 2022 06:31
@alvinlin123
Copy link
Contributor

LGTM, thanks for the contribution!

@alvinlin123 alvinlin123 merged commit 5742f57 into cortexproject:master Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants