mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Allow ipv6 urls in GetPortURL()
This commit is contained in:
parent
974f201363
commit
5e6eb467ac
@ -241,7 +241,8 @@ func GetPortURL(client clientset.Interface, ns, name string, svcPort int) (strin
|
|||||||
for _, address := range node.Status.Addresses {
|
for _, address := range node.Status.Addresses {
|
||||||
if address.Type == v1.NodeExternalIP {
|
if address.Type == v1.NodeExternalIP {
|
||||||
if address.Address != "" {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user