ipvs: only attempt setting of sysctlconnreuse on supported kernels

This builds on previous work but only sets the sysctlConnReuse value
if the kernel is known to be above 4.19. To avoid calling GetKernelVersion
twice, I store the value from the CanUseIPVS method and then check the version
constraint at time of expected sysctl call.

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
This commit is contained in:
Christopher M. Luciano
2020-02-25 14:47:53 -05:00
parent 381a372455
commit d22e18ad4f
2 changed files with 24 additions and 6 deletions

View File

@@ -276,6 +276,7 @@ func newProxyServer(
healthzServer,
config.IPVS.Scheduler,
config.NodePortAddresses,
kernelHandler,
)
} else {
var localDetector proxyutiliptables.LocalTrafficDetector
@@ -306,6 +307,7 @@ func newProxyServer(
healthzServer,
config.IPVS.Scheduler,
config.NodePortAddresses,
kernelHandler,
)
}
if err != nil {