From 8bb50d5a8cf92bdef05b7c7c3b1e98c344973ddc Mon Sep 17 00:00:00 2001 From: Aaron U'Ren Date: Sun, 12 May 2019 02:13:02 -0500 Subject: [PATCH] do not setup ipip tunneling when --enable-overlay is false (#722) --- pkg/controllers/routing/network_routes_controller.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/routing/network_routes_controller.go b/pkg/controllers/routing/network_routes_controller.go index db5b10e5d0..03e4260e7e 100644 --- a/pkg/controllers/routing/network_routes_controller.go +++ b/pkg/controllers/routing/network_routes_controller.go @@ -440,7 +440,8 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error { // create IPIP tunnels only when node is not in same subnet or overlay-type is set to 'full' // prevent creation when --override-nexthop=true as well - if (!sameSubnet || nrc.overlayType == "full") && !nrc.overrideNextHop { + // if the user has disabled overlays, don't create tunnels + if (!sameSubnet || nrc.overlayType == "full") && !nrc.overrideNextHop && nrc.enableOverlays { // create ip-in-ip tunnel and inject route as overlay is enabled var link netlink.Link var err error @@ -488,7 +489,7 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error { Dst: dst, Protocol: 0x11, } - } else { + } else if sameSubnet { route = &netlink.Route{ Dst: dst, Gw: nexthop,