Include the current version along side the available version.

When checkpoint emits a log message indicating an agent is out of
date, include the current version along with the available version
according to checkpoint.

Inspired by: log output in #993
This commit is contained in:
Sean Chittenden 2016-05-04 22:57:44 -07:00
parent 730dd7df47
commit 01b8311c94
1 changed files with 6 additions and 1 deletions

View File

@ -510,7 +510,12 @@ func (c *Command) checkpointResults(results *checkpoint.CheckResponse, err error
return return
} }
if results.Outdated { if results.Outdated {
c.Ui.Error(fmt.Sprintf("Newer Consul version available: %s", results.CurrentVersion)) versionStr := c.Version
if c.VersionPrerelease != "" {
versionStr += fmt.Sprintf("-%s", c.VersionPrerelease)
}
c.Ui.Error(fmt.Sprintf("Newer Consul version available: %s (currently running: %s)", results.CurrentVersion, versionStr))
} }
for _, alert := range results.Alerts { for _, alert := range results.Alerts {
switch alert.Level { switch alert.Level {