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 <liumengxinfly@gmail.com>
  • Loading branch information
oilbeater authored and bobz965 committed Jul 22, 2024
1 parent 010e3f5 commit 097b154
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 097b154

Please sign in to comment.