Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuratczyk committed Nov 22, 2024
1 parent 580fdee commit df4bb33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"math"
"os"
"os/signal"
"sort"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -397,16 +398,17 @@ func join_cluster(expectedInstance int, serviceName string) {
for i, node := range endpoints.Subsets[0].Addresses {
ips[i] = node.IP
}
ips = sort.StringSlice(ips)

Check failure on line 401 in cmd/root.go

View workflow job for this annotation

GitHub Actions / Lint

SA4029: sort.StringSlice is a type, not a function, and sort.StringSlice(ips) doesn't sort your values; consider using sort.Strings instead (staticcheck)

log.Debug("IPs found", ips)
log.Debug("IPs found", "all", ips, "selected", ips[0])
list, err := memberlist.Create(memberlist.DefaultLANConfig())
if err != nil {
panic("Failed to create memberlist: " + err.Error())
}

// join the cluster
for {
_, err = list.Join(ips)
_, err = list.Join([]string{ips[0]})
if err == nil {
break
}
Expand Down

0 comments on commit df4bb33

Please sign in to comment.