[kube-proxy] Harden change tracker and proxiers for unmatched IP versions

This commit is contained in:
Zihong Zheng
2018-02-16 20:15:00 -08:00
parent 2ae45e9f1b
commit 95cde4fb98
4 changed files with 39 additions and 4 deletions

View File

@@ -309,6 +309,8 @@ func NewProxier(ipt utiliptables.Interface,
if len(clusterCIDR) == 0 {
glog.Warningf("clusterCIDR not specified, unable to distinguish between internal and external traffic")
} else if utilnet.IsIPv6CIDR(clusterCIDR) != ipt.IsIpv6() {
return nil, fmt.Errorf("clusterCIDR %s has incorrect IP version: expect isIPv6=%t", clusterCIDR, ipt.IsIpv6())
}
healthChecker := healthcheck.NewServer(hostname, recorder, nil, nil) // use default implementations of deps