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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

libovsdb: ignore not found error when listing objects with a filter #2900

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/ovs/ovn-nb-logical_router_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package ovs

import (
"context"
"errors"
"fmt"

"github.com/ovn-org/libovsdb/client"
"github.com/ovn-org/libovsdb/model"
"github.com/ovn-org/libovsdb/ovsdb"
"github.com/scylladb/go-set/strset"
Expand Down Expand Up @@ -302,6 +304,9 @@ func (c *ovnClient) listLogicalRouterPoliciesByFilter(lrName string, filter func
for _, uuid := range lr.Policies {
policy, err := c.GetLogicalRouterPolicyByUUID(uuid)
if err != nil {
if errors.Is(err, client.ErrNotFound) {
continue
}
return nil, err
}
if filter == nil || filter(policy) {
Expand Down
5 changes: 5 additions & 0 deletions pkg/ovs/ovn-nb-logical_router_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package ovs

import (
"context"
"errors"
"fmt"

"github.com/ovn-org/libovsdb/client"
"github.com/ovn-org/libovsdb/model"
"github.com/ovn-org/libovsdb/ovsdb"
"github.com/scylladb/go-set/strset"
Expand Down Expand Up @@ -313,6 +315,9 @@ func (c *ovnClient) listLogicalRouterStaticRoutesByFilter(lrName string, filter
for _, uuid := range lr.StaticRoutes {
route, err := c.GetLogicalRouterStaticRouteByUUID(uuid)
if err != nil {
if errors.Is(err, client.ErrNotFound) {
continue
}
return nil, err
}
if filter == nil || filter(route) {
Expand Down
5 changes: 5 additions & 0 deletions pkg/ovs/ovn-nb-nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package ovs

import (
"context"
"errors"
"fmt"

"github.com/ovn-org/libovsdb/client"
"github.com/ovn-org/libovsdb/model"
"github.com/ovn-org/libovsdb/ovsdb"

Expand Down Expand Up @@ -338,6 +340,9 @@ func (c *ovnClient) listLogicalRouterNatByFilter(lrName string, filter func(rout
for _, uuid := range lr.Nat {
nat, err := c.GetNATByUUID(uuid)
if err != nil {
if errors.Is(err, client.ErrNotFound) {
continue
}
return nil, err
}
if filter == nil || filter(nat) {
Expand Down