From 2f3fe5d2580500ea3d3c75678f7a71ad9ddcb9a4 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Wed, 12 Oct 2022 15:05:00 -0700 Subject: [PATCH] use port forwarding on Linux with Docker Desktop --- pkg/drivers/kic/oci/info.go | 3 ++- pkg/minikube/driver/driver.go | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/drivers/kic/oci/info.go b/pkg/drivers/kic/oci/info.go index b8c7cf33ca..5f9166d677 100644 --- a/pkg/drivers/kic/oci/info.go +++ b/pkg/drivers/kic/oci/info.go @@ -35,6 +35,7 @@ type SysInfo struct { Rootless bool // Weather or not the docker is running on rootless mode StorageDriver string // the storage driver for the daemon (for example overlay2) Errors []string // any server issues + DockerOS string // used to detect if using Docker Desktop or Docker Engine on Linux } var ( @@ -70,7 +71,7 @@ func DaemonInfo(ociBin string) (SysInfo, error) { break } } - cachedSysInfo = &SysInfo{CPUs: d.NCPU, TotalMemory: d.MemTotal, OSType: d.OSType, Swarm: d.Swarm.LocalNodeState == "active", Rootless: rootless, StorageDriver: d.Driver, Errors: d.ServerErrors} + cachedSysInfo = &SysInfo{CPUs: d.NCPU, TotalMemory: d.MemTotal, OSType: d.OSType, Swarm: d.Swarm.LocalNodeState == "active", Rootless: rootless, StorageDriver: d.Driver, Errors: d.ServerErrors, DockerOS: d.OperatingSystem} return *cachedSysInfo, err } diff --git a/pkg/minikube/driver/driver.go b/pkg/minikube/driver/driver.go index c58e985e5e..3b8c67a849 100644 --- a/pkg/minikube/driver/driver.go +++ b/pkg/minikube/driver/driver.go @@ -212,6 +212,9 @@ func NeedsPortForward(name string) bool { if err != nil { panic(err) } + if runtime.GOOS == "linux" && si.DockerOS == "Docker Desktop" { + return true + } return si.Rootless }