Skip to content

Commit 5e6eb46

Browse files
committed
Allow ipv6 urls in GetPortURL()
1 parent 974f201 commit 5e6eb46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/e2e/framework/node/resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ func GetPortURL(client clientset.Interface, ns, name string, svcPort int) (strin
241241
for _, address := range node.Status.Addresses {
242242
if address.Type == v1.NodeExternalIP {
243243
if address.Address != "" {
244-
return fmt.Sprintf("http://%v:%v", address.Address, nodePort), nil
244+
host := net.JoinHostPort(address.Address, fmt.Sprint(nodePort))
245+
return fmt.Sprintf("http://%s", host), nil
245246
}
246247
}
247248
}

0 commit comments

Comments
 (0)