Warn if etcd key for the new cluster already exist

This commit is contained in:
Murat Kabilov 2017-04-07 17:19:56 +02:00
parent a5f0ef10d0
commit d4bb72989a
1 changed files with 2 additions and 2 deletions

View File

@ -147,10 +147,10 @@ func (c *Cluster) etcdKeyExists(keyName string) (bool, error) {
func (c *Cluster) Create() error { func (c *Cluster) Create() error {
keyExist, err := c.etcdKeyExists(fmt.Sprintf("/%s/%s", c.OpConfig.EtcdScope, c.Metadata.Name)) keyExist, err := c.etcdKeyExists(fmt.Sprintf("/%s/%s", c.OpConfig.EtcdScope, c.Metadata.Name))
if err != nil { if err != nil {
return fmt.Errorf("Can't check etcd key: %s", err) return fmt.Warnln("Can't check etcd key: %s", err)
} }
if keyExist { if keyExist {
return fmt.Errorf("Etcd key for the cluster already exists") return fmt.Warnln("Etcd key for the cluster already exists")
} }
//TODO: service will create endpoint implicitly //TODO: service will create endpoint implicitly
ep, err := c.createEndpoint() ep, err := c.createEndpoint()