提交 1dcd5cd3 编写于 作者: T Thomas Stromberg

Pick a more universal hostname, add comment about docker

上级 04320951
......@@ -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...))
......
......@@ -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")
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册