Skip to content

Commit

Permalink
Always provide version & storage type in status output (#9598)
Browse files Browse the repository at this point in the history
  • Loading branch information
aphorise committed Jul 27, 2020
1 parent f5f1123 commit 7880875
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion command/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ func OutputSealStatus(ui cli.Ui, client *api.Client, status *api.SealStatusRespo
}

out = append(out, fmt.Sprintf("Version | %s", status.Version))
out = append(out, fmt.Sprintf("Storage Type | %s", status.StorageType))

if status.ClusterName != "" && status.ClusterID != "" {
out = append(out, fmt.Sprintf("Cluster Name | %s", status.ClusterName))
Expand All @@ -347,14 +348,15 @@ func OutputSealStatus(ui cli.Ui, client *api.Client, status *api.SealStatusRespo
if err != nil && strings.Contains(err.Error(), "Vault is sealed") {
leaderStatus = &api.LeaderResponse{HAEnabled: true}
err = nil
}
}
if err != nil {
ui.Error(fmt.Sprintf("Error checking leader status: %s", err))
return 1
}

// Output if HA is enabled
out = append(out, fmt.Sprintf("HA Enabled | %t", leaderStatus.HAEnabled))

if leaderStatus.HAEnabled {
mode := "sealed"
if !status.Sealed {
Expand Down
1 change: 1 addition & 0 deletions http/sys_seal.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func handleSysSealStatusRaw(core *vault.Core, w http.ResponseWriter, r *http.Req
Sealed: true,
RecoverySeal: core.SealAccess().RecoveryKeySupported(),
StorageType: core.StorageType(),
Version: version.GetVersion().VersionNumber(),
})
return
}
Expand Down

0 comments on commit 7880875

Please sign in to comment.