1
0
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:
Sebastiaan van Steenis 2019-09-04 19:41:20 +02:00 committed by Alena Prokharchyk
parent 4833568e38
commit 4a4a2357d3

View File

@ -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...)
}