Skip to content

Commit

Permalink
Use the right port for docker in qemu driver
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Apr 4, 2022
1 parent 191ff5b commit 6a7f14e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/minikube/cmd/docker-env.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"k8s.io/klog/v2"

"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/drivers/qemu"
"k8s.io/minikube/pkg/minikube/bootstrapper/bsutil/kverify"
"k8s.io/minikube/pkg/minikube/command"
"k8s.io/minikube/pkg/minikube/constants"
Expand Down Expand Up @@ -290,11 +291,13 @@ var dockerEnvCmd = &cobra.Command{

d := co.CP.Host.Driver
port := constants.DockerDaemonPort
if driver.NeedsPortForward(driverName) {
if driver.NeedsPortForward(driverName) && driver.IsKIC(driverName) {
port, err = oci.ForwardedPort(driverName, cname, port)
if err != nil {
exit.Message(reason.DrvPortForward, "Error getting port binding for '{{.driver_name}} driver: {{.error}}", out.V{"driver_name": driverName, "error": err})
}
} else if driver.NeedsPortForward(driverName) && driverName == driver.QEMU2 {
port = d.(*qemu.Driver).EnginePort
}

hostname, err := d.GetSSHHostname()
Expand Down

0 comments on commit 6a7f14e

Please sign in to comment.