Skip to content

Commit 0b43753

Browse files
committed
utilnode: fix incorrect documentation about node name vs hostname
(The behavior is unchanged; the function always took a node name rather than a hostname. Now it just documents that correctly.)
1 parent 75242fc commit 0b43753

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/util/node/node.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ func GetNodeHostIP(node *v1.Node) (net.IP, error) {
108108
return nil, fmt.Errorf("host IP unknown; known addresses: %v", addresses)
109109
}
110110

111-
// GetNodeIP returns the ip of node with the provided hostname
112-
// If required, wait for the node to be defined.
113-
func GetNodeIP(client clientset.Interface, hostname string) net.IP {
111+
// GetNodeIP returns an IP (as with GetNodeHostIP) for the node with the provided name.
112+
// If required, it will wait for the node to be created.
113+
func GetNodeIP(client clientset.Interface, name string) net.IP {
114114
var nodeIP net.IP
115115
backoff := wait.Backoff{
116116
Steps: 6,
@@ -120,7 +120,7 @@ func GetNodeIP(client clientset.Interface, hostname string) net.IP {
120120
}
121121

122122
err := wait.ExponentialBackoff(backoff, func() (bool, error) {
123-
node, err := client.CoreV1().Nodes().Get(context.TODO(), hostname, metav1.GetOptions{})
123+
node, err := client.CoreV1().Nodes().Get(context.TODO(), name, metav1.GetOptions{})
124124
if err != nil {
125125
klog.Errorf("Failed to retrieve node info: %v", err)
126126
return false, nil

0 commit comments

Comments
 (0)