Skip to content

Commit

Permalink
Merge pull request #289 from masnax/fix-validate
Browse files Browse the repository at this point in the history
Don't use mDNS payload address for local node validation
  • Loading branch information
tomponline authored Apr 23, 2024
2 parents 0c6fff3 + 189e6fa commit 6719d9e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions microcloud/cmd/microcloud/main_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,15 @@ func validateSystems(s *service.Handler, systems map[string]InitSystem) (err err
// Ensure that no system's management address falls within the OVN ranges
// to prevent OVN from allocating an IP that's already in use.
for systemName, system := range systems {
systemAddr := net.ParseIP(system.ServerInfo.Address)
// If the system is ourselves, we don't have an mDNS payload so grab the address locally.
addr := system.ServerInfo.Address
if systemName == s.Name {
addr = s.Address
}

systemAddr := net.ParseIP(addr)
if systemAddr == nil {
return fmt.Errorf("Invalid address %q for system %q", system.ServerInfo.Address, systemName)
return fmt.Errorf("Invalid address %q for system %q", addr, systemName)
}

for _, ipRange := range ip4OVNRanges {
Expand Down

0 comments on commit 6719d9e

Please sign in to comment.