remove new cluster check

release-2.0
Barak Michener 2014-10-06 20:07:51 -04:00
parent 1a0195e07e
commit 8a311e5b76
2 changed files with 9 additions and 12 deletions

View File

@ -28,16 +28,14 @@ func (c *ServerConfig) Verify() error {
return fmt.Errorf("could not find name %v in cluster!", c.Name)
}
if c.ClusterState == ClusterStateValueNew {
// No identical IPs in the cluster peer list
urlMap := make(map[string]bool)
for _, m := range *c.Cluster {
for _, url := range m.PeerURLs {
if urlMap[url] {
return fmt.Errorf("duplicate url %v in server config", url)
}
urlMap[url] = true
// No identical IPs in the cluster peer list
urlMap := make(map[string]bool)
for _, m := range *c.Cluster {
for _, url := range m.PeerURLs {
if urlMap[url] {
return fmt.Errorf("duplicate url %v in server config", url)
}
urlMap[url] = true
}
}
return nil

View File

@ -19,9 +19,8 @@ func TestConfigVerify(t *testing.T) {
cluster := &Cluster{}
cluster.Set(tt.clusterSetting)
cfg := ServerConfig{
Name: "node1",
Cluster: cluster,
ClusterState: ClusterStateValueNew,
Name: "node1",
Cluster: cluster,
}
err := cfg.Verify()
if (err == nil) && tt.shouldError {