From 65d80a64e004eaf849a745af769c79d7ba61187e Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Wed, 4 May 2016 23:56:37 -0700 Subject: [PATCH] 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 hashicorp/consul#993 --- command/agent/command.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/command/agent/command.go b/command/agent/command.go index 717e0ea28..1ce19a933 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -339,7 +339,12 @@ func (c *Command) checkpointResults(results *checkpoint.CheckResponse, err error return } if results.Outdated { - c.Ui.Error(fmt.Sprintf("Newer Nomad version available: %s", results.CurrentVersion)) + versionStr := c.Version + if c.VersionPrerelease != "" { + versionStr += fmt.Sprintf("-%s", c.VersionPrerelease) + } + + c.Ui.Error(fmt.Sprintf("Newer Nomad version available: %s (currently running: %s)", results.CurrentVersion, versionStr)) } for _, alert := range results.Alerts { switch alert.Level {