Skip to content

Commit

Permalink
when router is deleted return success for static route deletion (#4266)
Browse files Browse the repository at this point in the history
Signed-off-by: oilbeater <[email protected]>
  • Loading branch information
oilbeater committed Jul 9, 2024
1 parent b16adb6 commit 331006f
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 @@ -134,12 +134,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 = &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 331006f

Please sign in to comment.