Explicitly pass IP family to proxier

Rather than re-determining it from the iptables object in both proxies.
This commit is contained in:
Dan Winship
2022-12-22 14:38:38 -05:00
parent fb84c4f0f0
commit e7ed7220eb
4 changed files with 17 additions and 16 deletions

View File

@@ -145,8 +145,10 @@ func newProxyServer(
klog.V(2).InfoS("DetectLocalMode", "LocalMode", string(detectLocalMode))
primaryFamily := v1.IPv4Protocol
primaryProtocol := utiliptables.ProtocolIPv4
if netutils.IsIPv6(nodeIP) {
primaryFamily = v1.IPv6Protocol
primaryProtocol = utiliptables.ProtocolIPv6
}
execer := exec.New()
@@ -216,6 +218,7 @@ func newProxyServer(
// TODO this has side effects that should only happen when Run() is invoked.
proxier, err = iptables.NewProxier(
primaryFamily,
iptInterface,
utilsysctl.New(),
execer,
@@ -290,6 +293,7 @@ func newProxyServer(
}
proxier, err = ipvs.NewProxier(
primaryFamily,
iptInterface,
ipvsInterface,
ipsetInterface,