From 263033a3d2cc8849fa9af47b4b184bb6160af91f Mon Sep 17 00:00:00 2001 From: Gil Raphaelli Date: Fri, 15 Dec 2017 17:41:13 -0500 Subject: [PATCH] do not change version globally, just print it on startup #396 introduced a bug where the index name contained invalid characters that were added to the global version. --- beater/server.go | 3 ++- cmd/root.go | 7 +------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/beater/server.go b/beater/server.go index e593c0480b5..1112f585706 100644 --- a/beater/server.go +++ b/beater/server.go @@ -5,6 +5,7 @@ import ( "net/http" "time" + "github.com/elastic/apm-server/version" "github.com/elastic/beats/libbeat/beat" "github.com/elastic/beats/libbeat/logp" ) @@ -24,7 +25,7 @@ func newServer(config Config, report reporter) *http.Server { } func run(server *http.Server, config Config) error { - logp.Info("Starting apm-server! Hit CTRL-C to stop it.") + logp.Info("Starting apm-server [%s]. Hit CTRL-C to stop it.", version.String()) logp.Info("Listening on: %s", server.Addr) switch config.Frontend.isEnabled() { case true: diff --git a/cmd/root.go b/cmd/root.go index 4a904bbd524..2d23090fc13 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -1,14 +1,10 @@ package cmd import ( - "fmt" - "github.com/spf13/pflag" "github.com/elastic/apm-server/beater" - "github.com/elastic/apm-server/version" "github.com/elastic/beats/libbeat/cmd" - libbeat "github.com/elastic/beats/libbeat/version" ) // Name of the beat (apm-server). @@ -22,6 +18,5 @@ var RootCmd *cmd.BeatsRootCmd func init() { var runFlags = pflag.NewFlagSet(Name, pflag.ExitOnError) - version := fmt.Sprintf("%s [%s]", libbeat.GetDefaultVersion(), version.String()) - RootCmd = cmd.GenRootCmdWithIndexPrefixWithRunFlags(Name, IdxPattern, version, beater.New, runFlags) + RootCmd = cmd.GenRootCmdWithIndexPrefixWithRunFlags(Name, IdxPattern, "", beater.New, runFlags) }