Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1017 from weaveworks/log-version-on-startup
Browse files Browse the repository at this point in the history
Log the daemon version on startup
  • Loading branch information
Sam Broughton authored Mar 23, 2018
2 parents 7f1b0fa + 6911497 commit 3d56be4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/fluxd/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ func checkForUpdates(clusterString string, gitString string, logger log.Logger)
return
}
if r.Outdated {
logger.Log("msg", "update available", "version", r.CurrentVersion, "URL", r.CurrentDownloadURL)
logger.Log("msg", "update available", "latest", r.CurrentVersion, "URL", r.CurrentDownloadURL)
return
}
logger.Log("msg", "up to date", "version", r.CurrentVersion)
logger.Log("msg", "up to date", "latest", r.CurrentVersion)
}

flags := map[string]string{
Expand Down
7 changes: 2 additions & 5 deletions cmd/fluxd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/weaveworks/flux/ssh"
)

var version string
var version = "unversioned"

const (
// The number of connections chosen for memcache and remote GETs should match for best performance (hence the single hardcoded value)
Expand Down Expand Up @@ -117,9 +117,6 @@ func main() {

fs.Parse(os.Args)

if version == "" {
version = "unversioned"
}
if *versionFlag {
fmt.Println(version)
os.Exit(0)
Expand All @@ -132,7 +129,7 @@ func main() {
logger = log.With(logger, "ts", log.DefaultTimestampUTC)
logger = log.With(logger, "caller", log.DefaultCaller)
}
logger.Log("started", true)
logger.Log("version", version)

// Argument validation

Expand Down

0 comments on commit 3d56be4

Please sign in to comment.