mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
Log missing public IP from AWS metadata.
This commit is contained in:
parent
adde7f548f
commit
57782459e6
@ -657,11 +657,14 @@ func (aws *AWSCloud) NodeAddresses(name string) ([]api.NodeAddress, error) {
|
||||
return nil, err
|
||||
}
|
||||
addresses = append(addresses, api.NodeAddress{Type: api.NodeInternalIP, Address: internalIP})
|
||||
// Legacy compatibility: the private ip was the legacy host ip
|
||||
addresses = append(addresses, api.NodeAddress{Type: api.NodeLegacyHostIP, Address: internalIP})
|
||||
|
||||
externalIP, err := aws.metadata.GetMetadata("public-ipv4")
|
||||
if err != nil {
|
||||
//Perhaps only log this as a warning the first time this method is called?
|
||||
//TODO: It would be nice to be able to determine the reason for the failure,
|
||||
// but the AWS client masks all failures with the same error description.
|
||||
glog.V(2).Info("Could not determine public IP from AWS metadata.")
|
||||
} else {
|
||||
addresses = append(addresses, api.NodeAddress{Type: api.NodeExternalIP, Address: externalIP})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user