Reorganize a bit of winkernel proxier setup

Rather than doing winkernel-specific parsing of generic config data in
cmd/kube-proxy, do it in pkg/proxy/winkernel.
This commit is contained in:
Dan Winship
2023-11-13 07:58:03 -05:00
parent 33bd5fb3c4
commit da05076868
2 changed files with 12 additions and 12 deletions

View File

@@ -25,7 +25,6 @@ import (
"errors"
"fmt"
"net"
"strconv"
// Enable pprof HTTP handlers.
_ "net/http/pprof"
@@ -83,11 +82,6 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
if initOnly {
return nil, fmt.Errorf("--init-only is not implemented on Windows")
}
var healthzPort int
if len(config.HealthzBindAddress) > 0 {
_, port, _ := net.SplitHostPort(config.HealthzBindAddress)
healthzPort, _ = strconv.Atoi(port)
}
var proxier proxy.Provider
var err error
@@ -100,8 +94,8 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
s.NodeIPs,
s.Recorder,
s.HealthzServer,
config.HealthzBindAddress,
config.Winkernel,
healthzPort,
)
} else {
proxier, err = winkernel.NewProxier(
@@ -112,8 +106,8 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
s.NodeIPs[s.PrimaryIPFamily],
s.Recorder,
s.HealthzServer,
config.HealthzBindAddress,
config.Winkernel,
healthzPort,
)
}
if err != nil {