Skip to content

Commit 8bb50d5

Browse files
aaurenmurali-reddy
authored andcommitted
do not setup ipip tunneling when --enable-overlay is false (#722)
1 parent 7181d6f commit 8bb50d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/controllers/routing/network_routes_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,8 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error {
440440

441441
// create IPIP tunnels only when node is not in same subnet or overlay-type is set to 'full'
442442
// prevent creation when --override-nexthop=true as well
443-
if (!sameSubnet || nrc.overlayType == "full") && !nrc.overrideNextHop {
443+
// if the user has disabled overlays, don't create tunnels
444+
if (!sameSubnet || nrc.overlayType == "full") && !nrc.overrideNextHop && nrc.enableOverlays {
444445
// create ip-in-ip tunnel and inject route as overlay is enabled
445446
var link netlink.Link
446447
var err error
@@ -488,7 +489,7 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error {
488489
Dst: dst,
489490
Protocol: 0x11,
490491
}
491-
} else {
492+
} else if sameSubnet {
492493
route = &netlink.Route{
493494
Dst: dst,
494495
Gw: nexthop,

0 commit comments

Comments
 (0)