Skip to content

Commit

Permalink
etcdmain: log detected machine host after update check
Browse files Browse the repository at this point in the history
Signed-off-by: Gyu-Ho Lee <[email protected]>
  • Loading branch information
gyuho committed Mar 2, 2017
1 parent b744425 commit 73f3e0a
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions etcdmain/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func startEtcdOrProxyV2() {
grpc.EnableTracing = false

cfg := newConfig()
defaultInitialCluster := cfg.InitialCluster

err := cfg.parse(os.Args[1:])
if err != nil {
Expand All @@ -85,7 +84,13 @@ func startEtcdOrProxyV2() {
GoMaxProcs := runtime.GOMAXPROCS(0)
plog.Infof("setting maximum number of CPUs to %d, total number of available CPUs is %d", GoMaxProcs, runtime.NumCPU())

(&cfg.Config).UpdateDefaultClusterFromName(defaultInitialCluster)
defaultHost, dhErr := (&cfg.Config).UpdateDefaultClusterFromName()
if defaultHost != "" && dhErr == nil {
plog.Infof("advertising using detected default host %q", defaultHost)
}
if dhErr != nil {
plog.Noticef("failed to detect default host (%v)", dhErr)
}

if cfg.Dir == "" {
cfg.Dir = fmt.Sprintf("%v.etcd", cfg.Name)
Expand Down Expand Up @@ -184,15 +189,6 @@ func startEtcdOrProxyV2() {

// startEtcd runs StartEtcd in addition to hooks needed for standalone etcd.
func startEtcd(cfg *embed.Config) (<-chan struct{}, <-chan error, error) {
defaultHost, dhErr := cfg.IsDefaultHost()
if defaultHost != "" {
if dhErr == nil {
plog.Infof("advertising using detected default host %q", defaultHost)
} else {
plog.Noticef("failed to detect default host, advertise falling back to %q (%v)", defaultHost, dhErr)
}
}

if cfg.Metrics == "extensive" {
grpc_prometheus.EnableHandlingTimeHistogram()
}
Expand Down

0 comments on commit 73f3e0a

Please sign in to comment.