mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Small fix to make tests pass when master node is registered
This commit is contained in:
parent
f15d8528b6
commit
48fefd0f53
@ -2497,15 +2497,11 @@ func NodeAddresses(nodelist *api.NodeList, addrType api.NodeAddressType) []strin
|
|||||||
return hosts
|
return hosts
|
||||||
}
|
}
|
||||||
|
|
||||||
// NodeSSHHosts returns SSH-able host names for all nodes. It returns an error
|
// NodeSSHHosts returns SSH-able host names for all schedulable nodes - this exludes master node.
|
||||||
// if it can't find an external IP for every node, though it still returns all
|
// It returns an error if it can't find an external IP for every node, though it still returns all
|
||||||
// hosts that it found in that case.
|
// hosts that it found in that case.
|
||||||
func NodeSSHHosts(c *client.Client) ([]string, error) {
|
func NodeSSHHosts(c *client.Client) ([]string, error) {
|
||||||
// It should be OK to list unschedulable Nodes here.
|
nodelist := ListSchedulableNodesOrDie(c)
|
||||||
nodelist, err := c.Nodes().List(api.ListOptions{})
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("error getting nodes: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(roberthbailey): Use the "preferred" address for the node, once such a thing is defined (#2462).
|
// TODO(roberthbailey): Use the "preferred" address for the node, once such a thing is defined (#2462).
|
||||||
hosts := NodeAddresses(nodelist, api.NodeExternalIP)
|
hosts := NodeAddresses(nodelist, api.NodeExternalIP)
|
||||||
|
Loading…
Reference in New Issue
Block a user