-
Notifications
You must be signed in to change notification settings - Fork 4.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
Env Flag Filtering #16683
Env Flag Filtering #16683
Conversation
- removed some duplication
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.
LGTM, just naming + nits
I did some testing with this. Here is something of interest that I found: Vault v1.9.3:
Vault
I would consider this a breaking change. Maybe we do want this behavior though? In which case, we should call this out in the upgrade guide and the changelog entry. It might be worth getting some more opinions here. |
I think the warnings within the JSON response payload are due to this PR: #14962. Is that what you're referring to as a breaking change, or the CLI warning " It does seem odd though that |
@tomhjp The breaking change I was referring to is the inclusion of As for the warnings, yes at first I was a bit confused. But maybe it makes sense if "endpoint" only refers to the |
I agree if the format is explicitly specified as json the output should be json-valid no matter the circumstances such as potential warnings. Thanks for pointing it out. I added a check on the desired format before printing the warnings, let me know if you think it's a proper way of hangling this. I believe with this adjustment since the warnings do not modify the behavior of the command but simply provide additional information on how it was already parsed we can consider this as non-breaking? Or we should still add a note to the upgrade guide? Sample results:
|
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.
Good point about the JSON output 👍 agreed on the approach here
Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Tom Proctor <[email protected]>
…o vault-2165-EnvFlagFiltering
Summary
Problem
Env flags passed at the end of a command generates undesired warnings, e.g.:
Context
Some flags are not tied to a command but to the general execution environment and are valid when passed at the very end. For example:
format=json
. Warnings introduced during this pull request could create false positives when environment flags are used appropriately as it treated any trailing flags as a potential user mistake.With this fix env flags are acceptable both as flags
options
andargs
vault <command> [options] [path] [args]
Example