cmd: adds env var backups to command flags#6508
Merged
johanfylling merged 2 commits intoopen-policy-agent:mainfrom Jan 29, 2024
Merged
cmd: adds env var backups to command flags#6508johanfylling merged 2 commits intoopen-policy-agent:mainfrom
johanfylling merged 2 commits intoopen-policy-agent:mainfrom
Conversation
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
anderseknert
reviewed
Jan 2, 2024
Member
anderseknert
left a comment
There was a problem hiding this comment.
Looks great! Just a few comments / questions.
23387c3 to
99321ac
Compare
Member
anderseknert
left a comment
There was a problem hiding this comment.
Thanks! Just a single nit to address left.
b997f94 to
97abd98
Compare
Contributor
|
Thanks four you contribution @colinjlacy! 😃 |
Signed-off-by: Colin Lacy <colinjlacy@gmail.com>
97abd98 to
b76157b
Compare
Contributor
Author
|
@johanfylling sorry for the delay, I was traveling all week. Conflicts resolved and commits squashed. Thanks! |
johanfylling
approved these changes
Jan 29, 2024
Contributor
johanfylling
left a comment
There was a problem hiding this comment.
Thank you for your contribution! 😃
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As requested in issue 4277, this branch adds environment variable backups to command flags found in the cmd package.
Why the changes in this PR are needed?
As documented in #4277 there are certain situations where explicit command flag values don't make the most sense, and it instead makes more sense to set environment variables that set command flag values as a backup, if the flags themselves aren't explicitly set.
What are the changes in this PR?
For each command flag in the
cmdpackage, a new environment variable is made available following the formatOPA_<cmd-name>_<flag-name>, in all uppercase letters. The value set by the environment variable will only be used if there was no command flag value set in the execution of the command in question.Notes to assist PR review:
This can be tested by setting any environment variable value that corresponds to an existing command flag, e.g.
OPA_FMT_WRITE=truefor thefmtcommand.Further comments:
fixes #4277