Commit 3217495f authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #47203 from spiffxp/selfclient-ipv6-loopback

Automatic merge from submit-queue (batch tested with PRs 48402, 47203, 47460, 48335, 48322) TestLoopbackHostPort should accept IPv6 loopback host Attempting to get unit tests to pass on darwin per [our unit testing policy](https://github.com/kubernetes/community/blob/master/contributors/devel/testing.md#unit-tests) part of #48509 /cc @kubernetes/sig-api-machinery-bugs
parents 03360d7b 8469b013
...@@ -17,7 +17,7 @@ limitations under the License. ...@@ -17,7 +17,7 @@ limitations under the License.
package server package server
import ( import (
"strings" "net"
"testing" "testing"
) )
...@@ -37,8 +37,8 @@ func TestLoopbackHostPort(t *testing.T) { ...@@ -37,8 +37,8 @@ func TestLoopbackHostPort(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
} }
if !strings.HasPrefix(host, "127.") { if ip := net.ParseIP(host); ip == nil || !ip.IsLoopback() {
t.Fatalf("expected host to start with 127., got %q", host) t.Fatalf("expected host to be loopback, got %q", host)
} }
if port != "443" { if port != "443" {
t.Fatalf("expected 443 as port, got %q", port) t.Fatalf("expected 443 as port, got %q", port)
......
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