Skip to content

Commit 8826378

Browse files
authored
Merge pull request kubernetes#83331 from aojea/getporturl_ipv6
Allow ipv6 urls in GetPortURL()
2 parents 2d491ac + 5e6eb46 commit 8826378

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)