-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cmd: adds env var backups to command flags #6508
cmd: adds env var backups to command flags #6508
Conversation
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Looks great! Just a few comments / questions.
23387c3
to
99321ac
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.
Thanks! Just a single nit to address left.
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.
Thanks, Colin! 😃
b997f94
to
97abd98
Compare
Thanks four you contribution @colinjlacy! 😃 |
Signed-off-by: Colin Lacy <[email protected]>
97abd98
to
b76157b
Compare
@johanfylling sorry for the delay, I was traveling all week. Conflicts resolved and commits squashed. Thanks! |
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.
Thank you for your contribution! 😃
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
cmd
package, 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=true
for thefmt
command.Further comments:
fixes #4277