|
|
@ -43,7 +43,7 @@ func gatewaySet(zi cluster.ZoneIterator, gw string) error { |
|
|
|
zi.ForEachZone(func(z *cluster.Zone) bool { |
|
|
|
zi.ForEachZone(func(z *cluster.Zone) bool { |
|
|
|
for _, m := range z.Machines { |
|
|
|
for _, m := range z.Machines { |
|
|
|
if m.Name == gw { |
|
|
|
if m.Name == gw { |
|
|
|
z.SetGateway(m.ID, true) |
|
|
|
_ = z.SetGateway(m.ID, true) |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -79,8 +79,8 @@ func gatewayUnset(zi cluster.ZoneIterator, ngw string) error { |
|
|
|
zi.ForEachZone(func(z *cluster.Zone) bool { |
|
|
|
zi.ForEachZone(func(z *cluster.Zone) bool { |
|
|
|
for _, m := range z.Machines { |
|
|
|
for _, m := range z.Machines { |
|
|
|
if m.Name == ngw && m.IsGateway() { |
|
|
|
if m.Name == ngw && m.IsGateway() { |
|
|
|
z.SetGateway(m.ID, false) |
|
|
|
_ = z.SetGateway(m.ID, false) |
|
|
|
m.RemoveWireguardConfig(0) |
|
|
|
_ = m.RemoveWireguardConfig(0) |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|