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

incusd/network/ovn: Remove internal routes to forward/load-balancers #1843

Merged
merged 1 commit into from
Mar 25, 2025
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
50 changes: 0 additions & 50 deletions internal/server/network/driver_ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -5115,31 +5115,6 @@ func (n *ovn) ForwardCreate(forward api.NetworkForwardsPost, clientType request.
return fmt.Errorf("Failed applying OVN load balancer: %w", err)
}

// Add internal static route to the network forward (helps with OVN IC).
var nexthop net.IP
if listenAddressNet.IP.To4() == nil {
routerV6, _, err := n.parseRouterIntPortIPv6Net()
if err == nil {
nexthop = routerV6
}
} else {
routerV4, _, err := n.parseRouterIntPortIPv4Net()
if err == nil {
nexthop = routerV4
}
}

if nexthop != nil {
err = n.ovnnb.CreateLogicalRouterRoute(context.TODO(), n.getRouterName(), true, networkOVN.OVNRouterRoute{NextHop: nexthop, Prefix: *listenAddressNet})
if err != nil {
return err
}

revert.Add(func() {
_ = n.ovnnb.DeleteLogicalRouterRoute(context.TODO(), n.getRouterName(), *listenAddressNet)
})
}

// Notify all other members to refresh their BGP prefixes.
notifier, err := cluster.NewNotifier(n.state, n.state.Endpoints.NetworkCert(), n.state.ServerCert(), cluster.NotifyAll)
if err != nil {
Expand Down Expand Up @@ -5501,31 +5476,6 @@ func (n *ovn) LoadBalancerCreate(loadBalancer api.NetworkLoadBalancersPost, clie
return fmt.Errorf("Failed applying OVN load balancer: %w", err)
}

// Add internal static route to the load-balancer (helps with OVN IC).
var nexthop net.IP
if listenAddressNet.IP.To4() == nil {
routerV6, _, err := n.parseRouterIntPortIPv6Net()
if err == nil {
nexthop = routerV6
}
} else {
routerV4, _, err := n.parseRouterIntPortIPv4Net()
if err == nil {
nexthop = routerV4
}
}

if nexthop != nil {
err = n.ovnnb.CreateLogicalRouterRoute(context.TODO(), n.getRouterName(), true, networkOVN.OVNRouterRoute{NextHop: nexthop, Prefix: *listenAddressNet})
if err != nil {
return err
}

revert.Add(func() {
_ = n.ovnnb.DeleteLogicalRouterRoute(context.TODO(), n.getRouterName(), *listenAddressNet)
})
}

// Notify all other members to refresh their BGP prefixes.
notifier, err := cluster.NewNotifier(n.state, n.state.Endpoints.NetworkCert(), n.state.ServerCert(), cluster.NotifyAll)
if err != nil {
Expand Down