mirror of
https://github.com/rancher/rke.git
synced 2025-05-10 01:15:43 +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"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
@ -124,10 +123,6 @@ func GetEtcdConnString(hosts []*hosts.Host, hostAddress string) string {
|
||||
}
|
||||
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 {
|
||||
connHosts = append([]string{"https://" + hostAddress + ":2379"}, connHosts...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user