Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use mDNS payload address for local node validation #289

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading