mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
Merge pull request #36362 from vwfs/fix_node_addresses
Automatic merge from submit-queue Fix setNodeAddress in combination with cloud providers <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md 2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md 3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes --> **What this PR does / why we need it**: Fixes a follow-up bug introduced by https://github.com/kubernetes/kubernetes/pull/36231 The PR missed to update node.Status.Addresses in case the host name was already set by the cloud provider. fixes #36234
This commit is contained in:
commit
08274447ff
@ -404,10 +404,11 @@ func (kl *Kubelet) setNodeAddress(node *api.Node) error {
|
||||
}
|
||||
if addressNodeHostName == nil {
|
||||
hostnameAddress := api.NodeAddress{Type: api.NodeHostName, Address: kl.GetHostname()}
|
||||
node.Status.Addresses = append(nodeAddresses, hostnameAddress)
|
||||
nodeAddresses = append(nodeAddresses, hostnameAddress)
|
||||
} else {
|
||||
glog.V(2).Infof("Using Node Hostname from cloudprovider: %q", addressNodeHostName.Address)
|
||||
}
|
||||
node.Status.Addresses = nodeAddresses
|
||||
} else {
|
||||
var ipAddr net.IP
|
||||
var err error
|
||||
|
Loading…
Reference in New Issue
Block a user