Skip to content

Commit

Permalink
when router is deleted return success for static route deletion
Browse files Browse the repository at this point in the history
Signed-off-by: oilbeater <[email protected]>
  • Loading branch information
oilbeater committed Jul 8, 2024
1 parent e25bf15 commit f97856d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/ovs/ovn-nb-logical_router_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,17 @@ func (c *OVNNbClient) UpdateLogicalRouterStaticRoute(route *ovnnb.LogicalRouterS
return nil
}

// DeleteLogicalRouterStaticRoute add a logical router static route
// DeleteLogicalRouterStaticRoute delete a logical router static route
func (c *OVNNbClient) DeleteLogicalRouterStaticRoute(lrName string, routeTable, policy *string, ipPrefix, nexthop string) error {
if policy == nil || len(*policy) == 0 {
policy = ptr.To(ovnnb.LogicalRouterStaticRoutePolicyDstIP)
}

lr, err := c.GetLogicalRouter(lrName, true)
if lr == nil && err == nil {
return nil
}

routes, err := c.ListLogicalRouterStaticRoutes(lrName, routeTable, policy, ipPrefix, nil)
if err != nil {
klog.Error(err)
Expand Down

0 comments on commit f97856d

Please sign in to comment.