Skip to content

Commit

Permalink
incusd/network/ovn: Require functional uplink
Browse files Browse the repository at this point in the history
Closes #1062

Signed-off-by: Stéphane Graber <[email protected]>
Sponsored-by: Luizalabs (https://luizalabs.com)
  • Loading branch information
stgraber committed Aug 1, 2024
1 parent 0a04d95 commit 42b5f40
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/server/network/driver_ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,11 @@ func (n *ovn) allocateUplinkPortIPs(uplinkNet Network, routerMAC net.HardwareAdd
routerExtPortIPv4 := net.ParseIP(n.config[ovnVolatileUplinkIPv4])
routerExtPortIPv6 := net.ParseIP(n.config[ovnVolatileUplinkIPv6])

// Check if uplink is viable at all.
if uplinkIPv4Net == nil && uplinkIPv6Net == nil {
return nil, fmt.Errorf("Uplink network doesn't have IPv4 or IPv6 configured")
}

// Decide whether we need to allocate new IP(s) and go to the expense of retrieving all allocated IPs.
if (uplinkIPv4Net != nil && routerExtPortIPv4 == nil) || (uplinkIPv6Net != nil && routerExtPortIPv6 == nil) {
err := n.state.DB.Cluster.Transaction(context.TODO(), func(ctx context.Context, tx *db.ClusterTx) error {
Expand Down

0 comments on commit 42b5f40

Please sign in to comment.