Skip to content

Commit

Permalink
Merge pull request #7739 from medyagh/windows_servicePort
Browse files Browse the repository at this point in the history
docker driver: Add Service & Tunnel features to windows
  • Loading branch information
medyagh authored Apr 17, 2020
2 parents 95171be + 27bd2a9 commit 4c887bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cmd/minikube/cmd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (

"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/browser"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/mustload"
Expand Down Expand Up @@ -78,7 +79,7 @@ var serviceCmd = &cobra.Command{
cname := ClusterFlagValue()
co := mustload.Healthy(cname)

if runtime.GOOS == "darwin" && co.Config.Driver == oci.Docker {
if driver.NeedsPortForward(co.Config.Driver) {
startKicServiceTunnel(svc, cname)
return
}
Expand Down Expand Up @@ -137,7 +138,7 @@ func startKicServiceTunnel(svc, configName string) {
service.PrintServiceList(os.Stdout, data)

openURLs(svc, urls)
out.WarningT("Because you are using docker driver on Mac, the terminal needs to be open to run it.")
out.WarningT("Because you are using a Docker driver on {{.operating_system}}, the terminal needs to be open to run it.", out.V{"operating_system": runtime.GOOS})

<-ctrlC

Expand Down
5 changes: 3 additions & 2 deletions cmd/minikube/cmd/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"os"
"os/signal"
"path/filepath"
"runtime"
"strconv"
"time"

Expand All @@ -30,6 +29,7 @@ import (

"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/mustload"
Expand Down Expand Up @@ -78,7 +78,8 @@ var tunnelCmd = &cobra.Command{
cancel()
}()

if runtime.GOOS == "darwin" && co.Config.Driver == oci.Docker {
if driver.NeedsPortForward(co.Config.Driver) {

port, err := oci.ForwardedPort(oci.Docker, cname, 22)
if err != nil {
exit.WithError("error getting ssh port", err)
Expand Down

0 comments on commit 4c887bb

Please sign in to comment.