diff --git a/pkg/controllers/routing/network_routes_controller.go b/pkg/controllers/routing/network_routes_controller.go index f0303a612a..c29c4362aa 100644 --- a/pkg/controllers/routing/network_routes_controller.go +++ b/pkg/controllers/routing/network_routes_controller.go @@ -467,11 +467,7 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error { } out, err := exec.Command("ip", "route", "list", "table", customRouteTableID).CombinedOutput() - if err != nil { - return fmt.Errorf("Failed to verify if route already exists in %s table: %s", - customRouteTableName, err.Error()) - } - if !strings.Contains(string(out), "dev "+tunnelName+" scope") { + if err != nil || !strings.Contains(string(out), "dev "+tunnelName+" scope") { if out, err = exec.Command("ip", "route", "add", nexthop.String(), "dev", tunnelName, "table", customRouteTableID).CombinedOutput(); err != nil { return fmt.Errorf("failed to add route in custom route table, err: %s, output: %s", err, string(out))