Merge pull request #80634 from aojea/translatev4v6

Don´t translate to IPv6 empty addresses
This commit is contained in:
Kubernetes Prow Robot 2019-07-26 08:06:12 -07:00 committed by GitHub
commit ee84c95bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,7 @@ var NetexecImageName = imageutils.GetE2EImage(imageutils.Agnhost)
// adding the well known prefix "0::ffff:" https://tools.ietf.org/html/rfc2765
// if the ip is IPv4 and the cluster IPFamily is IPv6, otherwise returns the same ip
func TranslateIPv4ToIPv6(ip string) string {
if TestContext.IPFamily == "ipv6" && !k8utilnet.IsIPv6String(ip) {
if TestContext.IPFamily == "ipv6" && !k8utilnet.IsIPv6String(ip) && ip != "" {
ip = "0::ffff:" + ip
}
return ip