mirror of
https://github.com/kubernetes/client-go.git
synced 2025-12-26 14:42:27 +00:00
Currently, client-go requires that an IPv6 address string for hostname has square brackets surrounding, so that it can be used with address:port in an API request. This change, removes that requirement, and has getListener() add the square brackets for IPv6 addresses for hosts. If IPv4 or hostname, the name will not be modified. Decided to change here, rather than everywhere client-go is used (thinking that there may be places where we DON'T want the square brackets applied). This issue was found in kubelet, which, at startup, creates a listener for services and nodes. If an IPv6 address is used, the URI was malformed. Kubernetes-commit: e17a501bcb7a3d2c5f4ff5c41f122fe155395dcd