Skip to content

Commit

Permalink
Fix for same issue as #750, but for network_routes_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
CertainLach committed Apr 26, 2020
1 parent 21ea5a5 commit 86ebd28
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/controllers/routing/network_routes_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 86ebd28

Please sign in to comment.