From cfa210568458a7464d0bcae5219e2a1328c36a77 Mon Sep 17 00:00:00 2001 From: Pavel Sviderski Date: Fri, 6 Sep 2024 15:06:50 +1000 Subject: [PATCH] add public IP to the end of endpoint list --- internal/daemon/token.go | 2 +- internal/machine/machine.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/daemon/token.go b/internal/daemon/token.go index 1fc67f0c..90a017b3 100644 --- a/internal/daemon/token.go +++ b/internal/daemon/token.go @@ -30,7 +30,7 @@ func MachineToken(dataDir string) (machine.Token, error) { publicIP, err := network.GetPublicIP() // Ignore the error if failed to get the public IP using API services. if err == nil { - ips = append([]netip.Addr{publicIP}, ips...) + ips = append(ips, publicIP) } endpoints := make([]netip.AddrPort, len(ips)) diff --git a/internal/machine/machine.go b/internal/machine/machine.go index c4ec9606..6d1108f2 100644 --- a/internal/machine/machine.go +++ b/internal/machine/machine.go @@ -177,7 +177,7 @@ func (m *Machine) InitCluster(machineName string, netPrefix netip.Prefix, users publicIP, err := network.GetPublicIP() // Ignore the error if failed to get the public IP using API services. if err == nil { - ips = append([]netip.Addr{publicIP}, ips...) + ips = append(ips, publicIP) } endpoints := make([]*pb.IPPort, len(ips)) for i, addr := range ips {