Skip to content

Commit f3ea1a6

Browse files
authored
Merge pull request #888 from CertainLach/master
Fix for same issue as #750, but for network_routes_controller
2 parents 21ea5a5 + 86ebd28 commit f3ea1a6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pkg/controllers/routing/network_routes_controller.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,7 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error {
467467
}
468468

469469
out, err := exec.Command("ip", "route", "list", "table", customRouteTableID).CombinedOutput()
470-
if err != nil {
471-
return fmt.Errorf("Failed to verify if route already exists in %s table: %s",
472-
customRouteTableName, err.Error())
473-
}
474-
if !strings.Contains(string(out), "dev "+tunnelName+" scope") {
470+
if err != nil || !strings.Contains(string(out), "dev "+tunnelName+" scope") {
475471
if out, err = exec.Command("ip", "route", "add", nexthop.String(), "dev", tunnelName, "table",
476472
customRouteTableID).CombinedOutput(); err != nil {
477473
return fmt.Errorf("failed to add route in custom route table, err: %s, output: %s", err, string(out))

0 commit comments

Comments
 (0)