Skip to content

Commit

Permalink
egressgw: fix up removal for IP routes
Browse files Browse the repository at this point in the history
Without specifying a filter, we're only getting the routes from the default
table. So explicitly get the routes from all tables for the reconciliation
of stale EgressGW IP routes.

Fixes: 9b9e7c2 ("egressgw: improve removal of IP routes")
Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann committed Jul 17, 2023
1 parent 438ed82 commit 569da6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/egressgateway/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"github.com/vishvananda/netlink"
"golang.org/x/sys/unix"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/util/workqueue"

Expand Down Expand Up @@ -768,7 +769,10 @@ nextIpRule:
}

// Fetch all IP routes, and delete the unused EgressGW-specific routes:
routes, err := netlink.RouteList(nil, netlink.FAMILY_V4)
routes, err := netlink.RouteListFiltered(netlink.FAMILY_V4, &netlink.Route{
Table: unix.RT_TABLE_UNSPEC,
}, netlink.RT_FILTER_TABLE)

if err != nil {
logger.WithError(err).Error("Cannot list IP routes")
return
Expand Down

0 comments on commit 569da6d

Please sign in to comment.