-
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
Skip Formatting For NIL Secret #18163
Conversation
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
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.
While this does address the panic, I do wonder if we want to continue displaying the secret path helper text when the field
flag is provided? The behavior from this change doesn't match the behavior of other KV commands like kv get
or kv put
where we don't print that information.
Ex:
❯ vault kv put secret/test foo=bar3
== Secret Path ==
secret/data/test
======= Metadata =======
Key Value
--- -----
created_time 2022-11-30T19:22:20.217002Z
custom_metadata <nil>
deletion_time n/a
destroyed false
version 5
❯ vault kv put -field=version secret/test foo=bar4
6
Thats a good point. Especially if the expectation is that this result will be piped into other commands, the extra information might do more harm than good. I will update. |
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!
* Skip formatting for a nil secret data * Same change for put * Add changelog * update changelog * modify filtered output
Vault is currently panicking when trying to
patch
with the-field
parameter set. This occurs because we are expecting there to be metadata around the secret, but none is getting returned due to the flag being set. A check has been added to ensure that thesecret
is populated before trying to access the Data from underneath it.Previous Error:
After change:
UPDATE:
updated output