mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 04:32:37 +00:00
Fixed the wrong elasticsearch node counter
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -104,7 +105,7 @@ func main() {
|
|||||||
var endpoints *api.Endpoints
|
var endpoints *api.Endpoints
|
||||||
addrs := []string{}
|
addrs := []string{}
|
||||||
// Wait for some endpoints.
|
// Wait for some endpoints.
|
||||||
count := 0
|
count, _ := strconv.Atoi(os.Getenv("MINIMUM_MASTER_NODES"))
|
||||||
for t := time.Now(); time.Since(t) < 5*time.Minute; time.Sleep(10 * time.Second) {
|
for t := time.Now(); time.Since(t) < 5*time.Minute; time.Sleep(10 * time.Second) {
|
||||||
endpoints, err = client.Core().Endpoints(namespace).Get(serviceName, metav1.GetOptions{})
|
endpoints, err = client.Core().Endpoints(namespace).Get(serviceName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -115,7 +116,6 @@ func main() {
|
|||||||
if len(addrs) > 0 && len(addrs) == count {
|
if len(addrs) > 0 && len(addrs) == count {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
count = len(addrs)
|
|
||||||
}
|
}
|
||||||
// If there was an error finding endpoints then log a warning and quit.
|
// If there was an error finding endpoints then log a warning and quit.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user