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 {