mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
return error when cannot join the cluster
This commit is contained in:
parent
01e5d41f91
commit
2eda27e9f4
3
etcd.go
3
etcd.go
@ -501,6 +501,9 @@ func joinCluster(s *raft.Server, serverName string) error {
|
|||||||
resp, err := t.Post(fmt.Sprintf("%s/join", serverName), &b)
|
resp, err := t.Post(fmt.Sprintf("%s/join", serverName), &b)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Unable to join: %v", err)
|
||||||
|
}
|
||||||
if resp != nil {
|
if resp != nil {
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
if resp.StatusCode == http.StatusOK {
|
if resp.StatusCode == http.StatusOK {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user