Unverified Commit c5a761cc authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #79575 from nikhita/ipv6-unit-test-fix

Allow unit test to pass on machines without ipv6
parents d5f2096f a50985cb
...@@ -59,7 +59,9 @@ func TestLoopbackHostPort(t *testing.T) { ...@@ -59,7 +59,9 @@ func TestLoopbackHostPort(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
} }
if ip := net.ParseIP(host); ip == nil || !ip.IsLoopback() || ip.To4() != nil { if host == "localhost" {
// can happen on machines without IPv6
} else if ip := net.ParseIP(host); ip == nil || !ip.IsLoopback() || ip.To4() != nil {
t.Fatalf("expected IPv6 host to be loopback, got %q", host) t.Fatalf("expected IPv6 host to be loopback, got %q", host)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment