Skip to content

Commit

Permalink
cmd/microcloud: Print warning if OVN underlay network is in Ceph clus…
Browse files Browse the repository at this point in the history
…ter subnet

Signed-off-by: Max Asnaashari <[email protected]>
  • Loading branch information
masnax committed Sep 14, 2024
1 parent 6971b93 commit 86b8b7a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cmd/microcloud/main_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,28 @@ func validateGatewayNet(config map[string]string, ipPrefix string, cidrValidator
}

func (c *initConfig) validateSystems(s *service.Handler) (err error) {
for _, sys := range c.systems {
if sys.MicroCephInternalNetworkSubnet == "" || sys.OVNGeneveAddr == "" {
continue
}

_, subnet, err := net.ParseCIDR(sys.MicroCephInternalNetworkSubnet)
if err != nil {
return fmt.Errorf("Failed to parse available network interface CIDR address: %q: %w", subnet, err)
}

underlayIP := net.ParseIP(sys.OVNGeneveAddr)
if underlayIP == nil {
return fmt.Errorf("OVN underlay IP %q is invalid", sys.OVNGeneveAddr)
}

if subnet.Contains(underlayIP) {
fmt.Printf("Warning: OVN underlay IP (%s) is shared with the Ceph cluster network (%s)\n", underlayIP.String(), subnet.String())

break
}
}

if !c.bootstrap {
return nil
}
Expand Down

0 comments on commit 86b8b7a

Please sign in to comment.