Explorar o código

fix(etcd): use transporter scheme in joinCluster

Follow the transporter scheme when trying to join the cluster. Otherwise
the scheme is empty and the http client errors.
Brandon Philips %!s(int64=12) %!d(string=hai) anos
pai
achega
3be13a38f1
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      etcd.go

+ 2 - 1
etcd.go

@@ -592,7 +592,8 @@ func joinCluster(s *raft.Server, serverName string) error {
 
 	debugf("Send Join Request to %s", serverName)
 
-	resp, err := t.Post(fmt.Sprintf("%s/join", serverName), &b)
+	joinURL := url.URL{Host: serverName, Scheme: raftTransporter.scheme, Path: "/join"}
+	resp, err := t.Post(joinURL.String(), &b)
 
 	for {
 		if err != nil {