From 1dcd5cd31077cd6132dea2f231361537e4fa3498 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 1 Apr 2020 14:38:46 -0700 Subject: [PATCH] Pick a more universal hostname, add comment about docker --- test/integration/cert_options_test.go | 7 +++---- test/integration/main.go | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/cert_options_test.go b/test/integration/cert_options_test.go index cdc95ea0d4..77d3081798 100644 --- a/test/integration/cert_options_test.go +++ b/test/integration/cert_options_test.go @@ -24,7 +24,7 @@ import ( "testing" ) -func TestCertOptionFlags(t *testing.T) { +func TestCertOptions(t *testing.T) { if NoneDriver() { t.Skip("skipping: none driver does not support ssh or bundle docker") } @@ -37,10 +37,9 @@ func TestCertOptionFlags(t *testing.T) { // Use the most verbose logging for the simplest test. If it fails, something is very wrong. args := append([]string{"start", "-p", profile, "--apiserver-ips=127.0.0.1,192.168.15.15", "--apiserver-names=localhost,www.google.com", "--apiserver-port=8555"}, StartArgs()...) - // We can safely override --apiserver-name with unique that works + // We can safely override --apiserver-name with if NeedsPortForward() { - args = append(args, "--apiserver-name=kubernetes.docker.internal") - + args = append(args, "--apiserver-name=localhost") } rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) diff --git a/test/integration/main.go b/test/integration/main.go index 144fae4395..2ef2d90731 100644 --- a/test/integration/main.go +++ b/test/integration/main.go @@ -74,7 +74,8 @@ func KicDriver() bool { return strings.Contains(*startArgs, "--driver=docker") || strings.Contains(*startArgs, "--vm-driver=docker") || strings.Contains(*startArgs, "--vm-driver=podman") || strings.Contains(*startArgs, "driver=podman") } -// NeedsPortForward requires whether or not this host needs port forwarding +// NeedsPortForward returns access to endpoints with this driver needs port forwarding +// (Docker on non-Linux platforms requires ports to be forwarded to 127.0.0.1) func NeedsPortForward() bool { return KicDriver() && (runtime.GOOS == "windows" || runtime.GOOS == "darwin") }