Skip to content
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

Add region capabilities for s3 destination #26

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

schorzz
Copy link

@schorzz schorzz commented Mar 2, 2022

No description provided.

@schorzz schorzz force-pushed the feature/configurable-s3-region branch from 99bf51d to e52489e Compare March 2, 2022 23:23
pkg/util/env.go Outdated
@@ -24,3 +24,11 @@ func FallbackToEnv(value string, envName string) string {
}
return value
}

func FallbackToDefault(fallback string, envName string) string {
Copy link

Choose a reason for hiding this comment

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

Suggested change
func FallbackToDefault(fallback string, envName string) string {
func EnvWithDefault(name string, d string) string {

What do you think of changing the order of arguments? It makes more sense in my head 😉

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, agree. I just wanted to have some kind of consistency between both util funcs. Makes also more sense to have the fallback as 2nd argument.

@schorzz schorzz force-pushed the feature/configurable-s3-region branch from e52489e to c196844 Compare March 3, 2022 23:00
@@ -90,6 +90,7 @@ var consulCmd = &cobra.Command{
DisableSSL: !s3c.UseSSL,
Bucket: s3c.Bucket,
Prefix: prefix,
Region: util.EnvWithDefault("us-east-1", "S3_REGION"),
Copy link

Choose a reason for hiding this comment

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

The order of arguments is not correct since you changed the signature 😉

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