mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 11:42:14 +00:00
Fixed the wrong elasticsearch node counter
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -104,7 +105,7 @@ func main() {
|
||||
var endpoints *api.Endpoints
|
||||
addrs := []string{}
|
||||
// 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) {
|
||||
endpoints, err = client.Core().Endpoints(namespace).Get(serviceName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
@@ -115,7 +116,6 @@ func main() {
|
||||
if len(addrs) > 0 && len(addrs) == count {
|
||||
break
|
||||
}
|
||||
count = len(addrs)
|
||||
}
|
||||
// If there was an error finding endpoints then log a warning and quit.
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user