mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-26 12:46:06 +00:00
Updating after merging with a conflicting commit
This commit is contained in:
@@ -294,10 +294,14 @@ func NewProxier(ipt utiliptables.Interface,
|
||||
ipFamily = v1.IPv6Protocol
|
||||
}
|
||||
|
||||
var incorrectAddresses []string
|
||||
nodePortAddresses, incorrectAddresses = utilproxy.FilterIncorrectCIDRVersion(nodePortAddresses, ipFamily)
|
||||
if len(incorrectAddresses) > 0 {
|
||||
klog.Warningf("NodePortAddresses of wrong family; %s", incorrectAddresses)
|
||||
isCIDR := true
|
||||
ipFamilyIPMap := utilproxy.MapIPsToIPFamily(nodePortAddresses, isCIDR)
|
||||
nodePortAddresses = ipFamilyIPMap[ipFamily]
|
||||
for ipFam, ips := range ipFamilyIPMap {
|
||||
// Log the IPs not matching the ipFamily
|
||||
if ipFam != ipFamily && len(ips) > 0 {
|
||||
klog.Warningf("IP Family: %s, NodePortAddresses of wrong family; %s", ipFamily, strings.Join(ips, ","))
|
||||
}
|
||||
}
|
||||
|
||||
proxier := &Proxier{
|
||||
@@ -367,17 +371,18 @@ func NewDualStackProxier(
|
||||
nodePortAddresses []string,
|
||||
) (proxy.Provider, error) {
|
||||
// Create an ipv4 instance of the single-stack proxier
|
||||
nodePortAddresses4, nodePortAddresses6 := utilproxy.FilterIncorrectCIDRVersion(nodePortAddresses, v1.IPv4Protocol)
|
||||
isCIDR := true
|
||||
ipFamilyIPMap := utilproxy.MapIPsToIPFamily(nodePortAddresses, isCIDR)
|
||||
ipv4Proxier, err := NewProxier(ipt[0], sysctl,
|
||||
exec, syncPeriod, minSyncPeriod, masqueradeAll, masqueradeBit, localDetectors[0], hostname,
|
||||
nodeIP[0], recorder, healthzServer, nodePortAddresses4)
|
||||
nodeIP[0], recorder, healthzServer, ipFamilyIPMap[v1.IPv4Protocol])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to create ipv4 proxier: %v", err)
|
||||
}
|
||||
|
||||
ipv6Proxier, err := NewProxier(ipt[1], sysctl,
|
||||
exec, syncPeriod, minSyncPeriod, masqueradeAll, masqueradeBit, localDetectors[1], hostname,
|
||||
nodeIP[1], recorder, healthzServer, nodePortAddresses6)
|
||||
nodeIP[1], recorder, healthzServer, ipFamilyIPMap[v1.IPv6Protocol])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to create ipv6 proxier: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user