mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
style comments
This commit is contained in:
parent
52dedab7b4
commit
cb5a638c44
@ -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)
|
||||
|
@ -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()))...)
|
||||
}
|
||||
|
2
main.go
2
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user