From 5e6eb467aca4ae1e9cdfb9057cb8af67d96c313c Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Mon, 30 Sep 2019 19:59:50 +0200 Subject: [PATCH] Allow ipv6 urls in GetPortURL() --- test/e2e/framework/node/resource.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/node/resource.go b/test/e2e/framework/node/resource.go index 5fa55ab9436..7601f03db38 100644 --- a/test/e2e/framework/node/resource.go +++ b/test/e2e/framework/node/resource.go @@ -241,7 +241,8 @@ func GetPortURL(client clientset.Interface, ns, name string, svcPort int) (strin for _, address := range node.Status.Addresses { if address.Type == v1.NodeExternalIP { if address.Address != "" { - return fmt.Sprintf("http://%v:%v", address.Address, nodePort), nil + host := net.JoinHostPort(address.Address, fmt.Sprint(nodePort)) + return fmt.Sprintf("http://%s", host), nil } } }