Skip to content

Commit

Permalink
[Issue:#115501] Fix for issue with Loadbalancer policy creation for I…
Browse files Browse the repository at this point in the history
…PV6 endpoints in Dualstack mode.
  • Loading branch information
princepereira committed Feb 3, 2023
1 parent fc7b25c commit 5eb6f82
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/proxy/winkernel/hns.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,28 @@ func (hns hns) getAllEndpointsByNetwork(networkName string) (map[string]*(endpoi
terminating: false,
}
endpointInfos[ep.IpConfigurations[0].IpAddress] = endpointInfos[ep.Id]

if len(ep.IpConfigurations) == 1 {
continue
}

// If ipFamilyPolicy is RequireDualStack or PreferDualStack, then there will be 2 IPS (iPV4 and IPV6)
// in the endpoint list
endpointDualstack := &endpointsInfo{
ip: ep.IpConfigurations[1].IpAddress,
isLocal: uint32(ep.Flags&hcn.EndpointFlagsRemoteEndpoint) == 0,
macAddress: ep.MacAddress,
hnsID: ep.Id,
hns: hns,
// only ready and not terminating endpoints were added to HNS
ready: true,
serving: true,
terminating: false,
}
endpointInfos[ep.IpConfigurations[1].IpAddress] = endpointDualstack
}
klog.V(3).InfoS("Queried endpoints from network", "network", networkName)
klog.V(5).InfoS("Queried endpoints details", "network", networkName, "endpointInfos", endpointInfos)
return endpointInfos, nil
}

Expand Down

0 comments on commit 5eb6f82

Please sign in to comment.