agent: display node id on start up for servers (#17084)

Signed-off-by: Bram Vogelaar <bram@attachmentgenie.com>
This commit is contained in:
Bram Vogelaar 2023-05-18 17:23:12 +02:00 committed by GitHub
parent fe29cf8b7b
commit 3b40f778e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

3
.changelog/17084.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
agent: Display server node ID in agent configuration at startup
```

View File

@ -781,6 +781,12 @@ func (c *Command) Run(args []string) int {
info["region"] = fmt.Sprintf("%s (DC: %s)", config.Region, config.Datacenter) info["region"] = fmt.Sprintf("%s (DC: %s)", config.Region, config.Datacenter)
info["bind addrs"] = c.getBindAddrSynopsis() info["bind addrs"] = c.getBindAddrSynopsis()
info["advertise addrs"] = c.getAdvertiseAddrSynopsis() info["advertise addrs"] = c.getAdvertiseAddrSynopsis()
if config.Server.Enabled {
serverConfig, err := c.agent.serverConfig()
if err == nil {
info["node id"] = serverConfig.NodeID
}
}
// Sort the keys for output // Sort the keys for output
infoKeys := make([]string, 0, len(info)) infoKeys := make([]string, 0, len(info))