mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #86001 from hubv/hubv-patch-1
Fix IPv6 addresses lost issue in pure ipv6 vsphere environment
This commit is contained in:
commit
ed8a260fb3
@ -572,7 +572,7 @@ func getLocalIP() ([]v1.NodeAddress, error) {
|
||||
} else {
|
||||
for _, addr := range localAddrs {
|
||||
if ipnet, ok := addr.(*net.IPNet); ok {
|
||||
if ipnet.IP.To4() != nil {
|
||||
if !ipnet.IP.IsLinkLocalUnicast() {
|
||||
// Filter external IP by MAC address OUIs from vCenter and from ESX
|
||||
vmMACAddr := strings.ToLower(i.HardwareAddr.String())
|
||||
// Making sure that the MAC address is long enough
|
||||
@ -683,7 +683,7 @@ func (vs *VSphere) NodeAddresses(ctx context.Context, nodeName k8stypes.NodeName
|
||||
for _, v := range vmMoList[0].Guest.Net {
|
||||
if vs.cfg.Network.PublicNetwork == v.Network {
|
||||
for _, ip := range v.IpAddress {
|
||||
if net.ParseIP(ip).To4() != nil {
|
||||
if !net.ParseIP(ip).IsLinkLocalUnicast() {
|
||||
nodehelpers.AddToNodeAddresses(&addrs,
|
||||
v1.NodeAddress{
|
||||
Type: v1.NodeExternalIP,
|
||||
|
Loading…
Reference in New Issue
Block a user