mirror of https://github.com/kubernetes/kops.git
ipv6: NPE fixes for IPv6-only instances
This commit is contained in:
parent
183f217f08
commit
63111f662a
|
|
@ -2432,7 +2432,9 @@ func GetInstanceCertificateNames(instances *ec2.DescribeInstancesOutput, useInst
|
||||||
addrs = append(addrs, *instance.InstanceId)
|
addrs = append(addrs, *instance.InstanceId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if instance.PrivateDnsName != nil {
|
||||||
addrs = append(addrs, *instance.PrivateDnsName)
|
addrs = append(addrs, *instance.PrivateDnsName)
|
||||||
|
}
|
||||||
|
|
||||||
// We only use data for the first interface, and only the first IP
|
// We only use data for the first interface, and only the first IP
|
||||||
for _, iface := range instance.NetworkInterfaces {
|
for _, iface := range instance.NetworkInterfaces {
|
||||||
|
|
@ -2442,7 +2444,9 @@ func GetInstanceCertificateNames(instances *ec2.DescribeInstancesOutput, useInst
|
||||||
if *iface.Attachment.DeviceIndex != 0 {
|
if *iface.Attachment.DeviceIndex != 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if iface.PrivateIpAddress != nil {
|
||||||
addrs = append(addrs, *iface.PrivateIpAddress)
|
addrs = append(addrs, *iface.PrivateIpAddress)
|
||||||
|
}
|
||||||
if iface.Ipv6Addresses != nil && len(iface.Ipv6Addresses) > 0 {
|
if iface.Ipv6Addresses != nil && len(iface.Ipv6Addresses) > 0 {
|
||||||
addrs = append(addrs, *iface.Ipv6Addresses[0].Ipv6Address)
|
addrs = append(addrs, *iface.Ipv6Addresses[0].Ipv6Address)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue