From f6c8b9b23863889cc423c6ba59081855a798c447 Mon Sep 17 00:00:00 2001 From: Prashanth Balasubramanian Date: Tue, 8 Mar 2016 15:06:01 -0800 Subject: [PATCH] Don't list master node when looking to a NodePort node. --- test/e2e/util.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/e2e/util.go b/test/e2e/util.go index fd720868ebd..a4344aff325 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -3267,9 +3267,16 @@ func getNodePortURL(client *client.Client, ns, name string, svcPort int) (string if err != nil { return "", err } - // It should be OK to list unschedulable Node here. - nodes, err := client.Nodes().List(api.ListOptions{}) - if err != nil { + // This list of nodes must not include the master, which is marked + // unschedulable, since the master doesn't run kube-proxy. Without + // kube-proxy NodePorts won't work. + var nodes *api.NodeList + if wait.PollImmediate(poll, singleCallTimeout, func() (bool, error) { + nodes, err = client.Nodes().List(api.ListOptions{FieldSelector: fields.Set{ + "spec.unschedulable": "false", + }.AsSelector()}) + return err == nil, nil + }) != nil { return "", err } if len(nodes.Items) == 0 {