vault operator init -output-curl-string bug (#17514)
* fixing -output-curl-string bug * add changelog * fix for -output-policy * adding comment for -output-policy
This commit is contained in:
parent
7bd4755142
commit
2d6c6c01c4
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
core: Fix vault operator init command to show the right curl string with -output-curl-string and right policy hcl with -output-policy
|
||||
```
|
|
@ -237,6 +237,15 @@ func (c *OperatorInitCommand) Run(args []string) int {
|
|||
return 2
|
||||
}
|
||||
|
||||
// -output-curl string returns curl command for seal status
|
||||
// setting this to false and then setting actual value after reading seal status
|
||||
currentOutputCurlString := client.OutputCurlString()
|
||||
client.SetOutputCurlString(false)
|
||||
// -output-policy string returns minimum required policy HCL for seal status
|
||||
// setting this to false and then setting actual value after reading seal status
|
||||
outputPolicy := client.OutputPolicy()
|
||||
client.SetOutputPolicy(false)
|
||||
|
||||
// Set defaults based on use of auto unseal seal
|
||||
sealInfo, err := client.Sys().SealStatus()
|
||||
if err != nil {
|
||||
|
@ -244,6 +253,9 @@ func (c *OperatorInitCommand) Run(args []string) int {
|
|||
return 2
|
||||
}
|
||||
|
||||
client.SetOutputCurlString(currentOutputCurlString)
|
||||
client.SetOutputPolicy(outputPolicy)
|
||||
|
||||
switch sealInfo.RecoverySeal {
|
||||
case true:
|
||||
if c.flagRecoveryShares == 0 {
|
||||
|
|
Loading…
Reference in New Issue