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 env substitution to pathorcontent #4327

Merged
merged 2 commits into from
Jun 11, 2021

Conversation

saswatamcode
Copy link
Member

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

This PR adds environment variable substitution to pathorcontent flag by replacing pkg/extflag/pathorcontent.go with github.com/efficientgo/tools/extkingpin. This was added as a new module here. Addresses #4293.

Verification

Tested locally.

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
bwplotka
bwplotka previously approved these changes Jun 11, 2021
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

This LGTM, but let's wait for others 👀 too.

@thanos-io/thanos-maintainers this moves pathOrContent to separate reusable go module BUT it also adds environment variable substitution which makes our flags with config accept environment variables within YAML config using $()


return extflag.RegisterPathOrContent(cmd, fmt.Sprintf("objstore%s.config", suffix), help, required)
opts := []extflag.Option{extflag.WithEnvSubstitution()}
if required {
Copy link
Member

Choose a reason for hiding this comment

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

👍🏽

@bwplotka bwplotka requested review from kakkoyun and onprem June 11, 2021 07:24
kakkoyun
kakkoyun previously approved these changes Jun 11, 2021
Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Only one nit about the changelog.

CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
@saswatamcode saswatamcode dismissed stale reviews from kakkoyun and bwplotka via 5a7cf54 June 11, 2021 07:53
@kakkoyun kakkoyun enabled auto-merge (squash) June 11, 2021 08:01
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.

3 participants