Skip to content

Commit 2e2060f

Browse files
committed
Merge PR #9078: Add go version to server message output
1 parent 8a3cbf0 commit 2e2060f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

command/server.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ func (c *ServerCommand) runRecoveryMode() int {
602602
infoKeys = append(infoKeys, "version")
603603
verInfo := version.GetVersion()
604604
info["version"] = verInfo.FullVersionNumber(false)
605+
605606
if verInfo.Revision != "" {
606607
info["version sha"] = strings.Trim(verInfo.Revision, "'")
607608
infoKeys = append(infoKeys, "version sha")
@@ -610,17 +611,23 @@ func (c *ServerCommand) runRecoveryMode() int {
610611
infoKeys = append(infoKeys, "recovery mode")
611612
info["recovery mode"] = "true"
612613

614+
infoKeys = append(infoKeys, "go version")
615+
info["go version"] = runtime.Version()
616+
613617
// Server configuration output
614618
padding := 24
619+
615620
sort.Strings(infoKeys)
616621
c.UI.Output("==> Vault server configuration:\n")
622+
617623
for _, k := range infoKeys {
618624
c.UI.Output(fmt.Sprintf(
619625
"%s%s: %s",
620626
strings.Repeat(" ", padding-len(k)),
621627
strings.Title(k),
622628
info[k]))
623629
}
630+
624631
c.UI.Output("")
625632

626633
for _, ln := range lns {
@@ -1512,6 +1519,7 @@ CLUSTER_SYNTHESIS_COMPLETE:
15121519
info["version sha"] = strings.Trim(verInfo.Revision, "'")
15131520
infoKeys = append(infoKeys, "version sha")
15141521
}
1522+
15151523
infoKeys = append(infoKeys, "cgo")
15161524
info["cgo"] = "disabled"
15171525
if version.CgoEnabled {
@@ -1521,17 +1529,23 @@ CLUSTER_SYNTHESIS_COMPLETE:
15211529
infoKeys = append(infoKeys, "recovery mode")
15221530
info["recovery mode"] = "false"
15231531

1532+
infoKeys = append(infoKeys, "go version")
1533+
info["go version"] = runtime.Version()
1534+
15241535
// Server configuration output
15251536
padding := 24
1537+
15261538
sort.Strings(infoKeys)
15271539
c.UI.Output("==> Vault server configuration:\n")
1540+
15281541
for _, k := range infoKeys {
15291542
c.UI.Output(fmt.Sprintf(
15301543
"%s%s: %s",
15311544
strings.Repeat(" ", padding-len(k)),
15321545
strings.Title(k),
15331546
info[k]))
15341547
}
1548+
15351549
c.UI.Output("")
15361550

15371551
// Tests might not want to start a vault server and just want to verify
@@ -2098,23 +2112,30 @@ func (c *ServerCommand) enableThreeNodeDevCluster(base *vault.CoreConfig, info m
20982112
info["version sha"] = strings.Trim(verInfo.Revision, "'")
20992113
infoKeys = append(infoKeys, "version sha")
21002114
}
2115+
21012116
infoKeys = append(infoKeys, "cgo")
21022117
info["cgo"] = "disabled"
21032118
if version.CgoEnabled {
21042119
info["cgo"] = "enabled"
21052120
}
21062121

2122+
infoKeys = append(infoKeys, "go version")
2123+
info["go version"] = runtime.Version()
2124+
21072125
// Server configuration output
21082126
padding := 24
2127+
21092128
sort.Strings(infoKeys)
21102129
c.UI.Output("==> Vault server configuration:\n")
2130+
21112131
for _, k := range infoKeys {
21122132
c.UI.Output(fmt.Sprintf(
21132133
"%s%s: %s",
21142134
strings.Repeat(" ", padding-len(k)),
21152135
strings.Title(k),
21162136
info[k]))
21172137
}
2138+
21182139
c.UI.Output("")
21192140

21202141
for _, core := range testCluster.Cores {

0 commit comments

Comments
 (0)