From f41457c151c352d0ae5b49bdd098bd2ffe053641 Mon Sep 17 00:00:00 2001 From: Serguei Bezverkhi Date: Thu, 10 Aug 2017 21:13:46 -0400 Subject: [PATCH] Adding support for internal IP for e2e tests Currently IssueSSHComand in util.go only checks for External IP address to shh, this PR adds check for internal IP too. --- test/e2e/framework/util.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index a464f3c7e46..08c35173b57 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -3219,7 +3219,17 @@ func IssueSSHCommandWithResult(cmd, provider string, node *v1.Node) (*SSHResult, } if host == "" { - return nil, fmt.Errorf("couldn't find external IP address for node %s", node.Name) + // No external IPs were found, let's try to use internal as plan B + for _, a := range node.Status.Addresses { + if a.Type == v1.NodeInternalIP { + host = net.JoinHostPort(a.Address, sshPort) + break + } + } + } + + if host == "" { + return nil, fmt.Errorf("couldn't find any IP address for node %s", node.Name) } Logf("SSH %q on %s(%s)", cmd, node.Name, host)