proxy/ipvs: Check that a dummy virtual server can be added

This tests both ipvs and the configured scheduler
This commit is contained in:
Lars Ekman
2022-12-22 20:36:53 +01:00
parent 4f02671b23
commit cd15ca0548
3 changed files with 130 additions and 70 deletions

View File

@@ -240,10 +240,10 @@ func newProxyServer(
} else if proxyMode == proxyconfigapi.ProxyModeIPVS {
kernelHandler := ipvs.NewLinuxKernelHandler()
ipsetInterface = utilipset.New(execer)
if err := ipvs.CanUseIPVSProxier(kernelHandler, ipsetInterface, config.IPVS.Scheduler); err != nil {
ipvsInterface = utilipvs.New()
if err := ipvs.CanUseIPVSProxier(ipvsInterface, ipsetInterface, config.IPVS.Scheduler); err != nil {
return nil, fmt.Errorf("can't use the IPVS proxier: %v", err)
}
ipvsInterface = utilipvs.New()
klog.InfoS("Using ipvs Proxier")
if dualStack {