diff --git a/etcdserver/config.go b/etcdserver/config.go index 6bff1eac4..3f5452ae5 100644 --- a/etcdserver/config.go +++ b/etcdserver/config.go @@ -41,6 +41,10 @@ type ServerConfig struct { // VerifyBootstrapConfig sanity-checks the initial config and returns an error // for things that should never happen. func (c *ServerConfig) VerifyBootstrapConfig() error { + if c.NodeID == raft.None { + return fmt.Errorf("could not use %x as member id", raft.None) + } + if c.DiscoveryURL == "" && c.ClusterState != ClusterStateValueNew { return fmt.Errorf("initial cluster state unset and no wal or discovery URL found") } @@ -55,9 +59,6 @@ func (c *ServerConfig) VerifyBootstrapConfig() error { if !isOk { return fmt.Errorf("couldn't find local ID in cluster config") } - if c.NodeID == raft.None { - return fmt.Errorf("could not use %x as member id", raft.None) - } // No identical IPs in the cluster peer list urlMap := make(map[string]bool) diff --git a/etcdserver/member.go b/etcdserver/member.go index 8919b5504..5d38ad2bc 100644 --- a/etcdserver/member.go +++ b/etcdserver/member.go @@ -61,10 +61,7 @@ func newMember(name string, peerURLs types.URLs, clusterName string, now *time.T b = append(b, []byte(p)...) } - if clusterName != "" { - b = append(b, []byte(clusterName)...) - } - + b = append(b, []byte(clusterName)...) if now != nil { b = append(b, []byte(fmt.Sprintf("%d", now.Unix()))...) } diff --git a/main.go b/main.go index 07b7dbc04..3b6e2f36d 100644 --- a/main.go +++ b/main.go @@ -291,7 +291,7 @@ func setupCluster() (*etcdserver.Member, error) { return c, nil } } - return nil, fmt.Errorf("etcd: cannot find the passed name %s in --initial-cluster bootstrap list.", *name) + return nil, fmt.Errorf("cannot find the passed name %s in --initial-cluster bootstrap list.", *name) } return cluster.FindName(*name), nil }