From 0b43753be78ad8080adcc1b1a20cddc0e93b8732 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 1 Oct 2020 11:20:46 -0400 Subject: [PATCH] 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.) --- pkg/util/node/node.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/util/node/node.go b/pkg/util/node/node.go index 2d3f470b79e..6ec37485228 100644 --- a/pkg/util/node/node.go +++ b/pkg/util/node/node.go @@ -108,9 +108,9 @@ func GetNodeHostIP(node *v1.Node) (net.IP, error) { return nil, fmt.Errorf("host IP unknown; known addresses: %v", addresses) } -// GetNodeIP returns the ip of node with the provided hostname -// If required, wait for the node to be defined. -func GetNodeIP(client clientset.Interface, hostname string) net.IP { +// GetNodeIP returns an IP (as with GetNodeHostIP) for the node with the provided name. +// If required, it will wait for the node to be created. +func GetNodeIP(client clientset.Interface, name string) net.IP { var nodeIP net.IP backoff := wait.Backoff{ Steps: 6, @@ -120,7 +120,7 @@ func GetNodeIP(client clientset.Interface, hostname string) net.IP { } err := wait.ExponentialBackoff(backoff, func() (bool, error) { - node, err := client.CoreV1().Nodes().Get(context.TODO(), hostname, metav1.GetOptions{}) + node, err := client.CoreV1().Nodes().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { klog.Errorf("Failed to retrieve node info: %v", err) return false, nil