mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 10:12:35 +00:00
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:
3
changelog/17514.txt
Normal file
3
changelog/17514.txt
Normal file
@@ -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
|
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
|
// Set defaults based on use of auto unseal seal
|
||||||
sealInfo, err := client.Sys().SealStatus()
|
sealInfo, err := client.Sys().SealStatus()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -244,6 +253,9 @@ func (c *OperatorInitCommand) Run(args []string) int {
|
|||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.SetOutputCurlString(currentOutputCurlString)
|
||||||
|
client.SetOutputPolicy(outputPolicy)
|
||||||
|
|
||||||
switch sealInfo.RecoverySeal {
|
switch sealInfo.RecoverySeal {
|
||||||
case true:
|
case true:
|
||||||
if c.flagRecoveryShares == 0 {
|
if c.flagRecoveryShares == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user