Skip to content

Commit 1138727

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#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 kubernetes#67714 ```release-note NONE ```
2 parents cd06419 + 722e0bc commit 1138727

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/cloudprovider/providers/vsphere/vsphere.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,13 @@ func (vs *VSphere) getVMFromNodeName(ctx context.Context, nodeName k8stypes.Node
606606
func (vs *VSphere) NodeAddresses(ctx context.Context, nodeName k8stypes.NodeName) ([]v1.NodeAddress, error) {
607607
// Get local IP addresses if node is local node
608608
if vs.hostName == convertToString(nodeName) {
609-
return getLocalIP()
609+
addrs, err := getLocalIP()
610+
if err != nil {
611+
return nil, err
612+
}
613+
// add the hostname address
614+
v1helper.AddToNodeAddresses(&addrs, v1.NodeAddress{Type: v1.NodeHostName, Address: vs.hostName})
615+
return addrs, nil
610616
}
611617

612618
if vs.cfg == nil {

0 commit comments

Comments
 (0)