Skip Formatting For NIL Secret (#18163)

* Skip formatting for a nil secret data

* Same change for put

* Add changelog

* update changelog

* modify filtered output
This commit is contained in:
Luis (LT) Carbonell 2022-12-01 13:36:24 -06:00 committed by GitHub
parent 495c503b11
commit afdb571319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

3
changelog/18163.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
cli/kv: skip formatting of nil secrets for patch and put with field parameter set
```

View File

@ -252,6 +252,14 @@ func (c *KVPatchCommand) Run(args []string) int {
if code != 0 { if code != 0 {
return code return code
} }
if secret == nil {
// Don't output anything if there's no secret
return 0
}
if c.flagField != "" {
return PrintRawField(c.UI, secret, c.flagField)
}
if Format(c.UI) == "table" { if Format(c.UI) == "table" {
outputPath(c.UI, fullPath, "Secret Path") outputPath(c.UI, fullPath, "Secret Path")