mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
add public IP to the end of endpoint list
This commit is contained in:
1 parent
7e93abb972
commit
cfa2105684
2 files changed
+2
-2
No files matched your search
@@ -30,7 +30,7 @@ func MachineToken(dataDir string) (machine.Token, error) {
|
|||||||
publicIP, err := network.GetPublicIP()
|
publicIP, err := network.GetPublicIP()
|
||||||
// Ignore the error if failed to get the public IP using API services.
|
// Ignore the error if failed to get the public IP using API services.
|
||||||
if err == nil {
|
if err == nil {
|
||||||
ips = append([]netip.Addr{publicIP}, ips...)
|
ips = append(ips, publicIP)
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoints := make([]netip.AddrPort, len(ips))
|
endpoints := make([]netip.AddrPort, len(ips))
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ func (m *Machine) InitCluster(machineName string, netPrefix netip.Prefix, users
|
|||||||
publicIP, err := network.GetPublicIP()
|
publicIP, err := network.GetPublicIP()
|
||||||
// Ignore the error if failed to get the public IP using API services.
|
// Ignore the error if failed to get the public IP using API services.
|
||||||
if err == nil {
|
if err == nil {
|
||||||
ips = append([]netip.Addr{publicIP}, ips...)
|
ips = append(ips, publicIP)
|
||||||
}
|
}
|
||||||
endpoints := make([]*pb.IPPort, len(ips))
|
endpoints := make([]*pb.IPPort, len(ips))
|
||||||
for i, addr := range ips {
|
for i, addr := range ips {
|
||||||
|
|||||||
Reference in new issue
Block a user