Skip to content

Commit

Permalink
do not change version globally, just print it on startup (#404)
Browse files Browse the repository at this point in the history
#396 introduced a bug where the index name contained invalid characters
that were added to the global version.
  • Loading branch information
graphaelli committed Dec 15, 2017
1 parent 909ff76 commit ba6b7ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion beater/server.go
Expand Up @@ -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"
)
Expand All @@ -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:
Expand Down
7 changes: 1 addition & 6 deletions 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).
Expand All @@ -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)
}

0 comments on commit ba6b7ad

Please sign in to comment.