Skip to content

Commit 8aa4324

Browse files
rmennmurali-reddy
authored andcommitted
adds explicit check for existing tunnel to avoid partial matches (#442)
1 parent 5421068 commit 8aa4324

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controllers/routing/network_routes_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error {
391391
return fmt.Errorf("Failed to verify if route already exists in %s table: %s",
392392
customRouteTableName, err.Error())
393393
}
394-
if !strings.Contains(string(out), tunnelName) {
394+
if !strings.Contains(string(out), "dev "+tunnelName+" scope") {
395395
if out, err = exec.Command("ip", "route", "add", nexthop.String(), "dev", tunnelName, "table",
396396
customRouteTableID).CombinedOutput(); err != nil {
397397
return fmt.Errorf("failed to add route in custom route table, err: %s, output: %s", err, string(out))

0 commit comments

Comments
 (0)