mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
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:
commit
113872798d
@ -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) {
|
func (vs *VSphere) NodeAddresses(ctx context.Context, nodeName k8stypes.NodeName) ([]v1.NodeAddress, error) {
|
||||||
// Get local IP addresses if node is local node
|
// Get local IP addresses if node is local node
|
||||||
if vs.hostName == convertToString(nodeName) {
|
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 {
|
if vs.cfg == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user