mirror of
https://github.com/rancher/rke.git
synced 2025-08-01 23:33:39 +00:00
Do not randomize etcd-servers in kube-apiserver
This commit is contained in:
parent
4833568e38
commit
4a4a2357d3
@ -6,7 +6,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math/rand"
|
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
@ -124,10 +123,6 @@ func GetEtcdConnString(hosts []*hosts.Host, hostAddress string) string {
|
|||||||
}
|
}
|
||||||
connHosts = append(connHosts, "https://"+host.InternalAddress+":2379")
|
connHosts = append(connHosts, "https://"+host.InternalAddress+":2379")
|
||||||
}
|
}
|
||||||
rand.Seed(time.Now().UnixNano())
|
|
||||||
rand.Shuffle(len(connHosts), func(i, j int) {
|
|
||||||
connHosts[i], connHosts[j] = connHosts[j], connHosts[i]
|
|
||||||
})
|
|
||||||
if containsHostAddress {
|
if containsHostAddress {
|
||||||
connHosts = append([]string{"https://" + hostAddress + ":2379"}, connHosts...)
|
connHosts = append([]string{"https://" + hostAddress + ":2379"}, connHosts...)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user