Merge pull request #67922 from liggitt/vsphere-hostname

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Report Hostname node address for vsphere

xref https://github.com/kubernetes/kubernetes/issues/67714

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-08-28 20:28:32 -07:00 committed by GitHub
commit 113872798d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -606,7 +606,13 @@ func (vs *VSphere) getVMFromNodeName(ctx context.Context, nodeName k8stypes.Node
func (vs *VSphere) NodeAddresses(ctx context.Context, nodeName k8stypes.NodeName) ([]v1.NodeAddress, error) {
// Get local IP addresses if node is local node
if vs.hostName == convertToString(nodeName) {
return getLocalIP()
addrs, err := getLocalIP()
if err != nil {
return nil, err
}
// add the hostname address
v1helper.AddToNodeAddresses(&addrs, v1.NodeAddress{Type: v1.NodeHostName, Address: vs.hostName})
return addrs, nil
}
if vs.cfg == nil {