mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
operator: init -status to return JSON (#8773)
This commit is contained in:
@@ -489,13 +489,25 @@ func (c *OperatorInitCommand) status(client *api.Client) int {
|
|||||||
return 1 // Normally we'd return 2, but 2 means something special here
|
return 1 // Normally we'd return 2, but 2 means something special here
|
||||||
}
|
}
|
||||||
|
|
||||||
if inited {
|
errorCode := 0
|
||||||
c.UI.Output("Vault is initialized")
|
|
||||||
return 0
|
if !inited {
|
||||||
|
errorCode = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
c.UI.Output("Vault is not initialized")
|
switch Format(c.UI) {
|
||||||
return 2
|
case "table":
|
||||||
|
if inited {
|
||||||
|
c.UI.Output("Vault is initialized")
|
||||||
|
} else {
|
||||||
|
c.UI.Output("Vault is not initialized")
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
data := api.InitStatusResponse{Initialized: inited}
|
||||||
|
OutputData(c.UI, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
return errorCode
|
||||||
}
|
}
|
||||||
|
|
||||||
// machineInit is used to output information about the init command.
|
// machineInit is used to output information about the init command.
|
||||||
|
|||||||
Reference in New Issue
Block a user