Skip to content

Commit

Permalink
pkg.drivers.none: use 127.0.0.1 as machine IP
Browse files Browse the repository at this point in the history
I'm not positive on why do we ever need to pick a machine's external IP
for this. Alongside other things, this prohibits using
`minikube --vm-driver=none` on machines without Internet connectivity,
which is stupid.
Fixes kubernetes#3013, kubernetes#2762 and possibly many more similar issues.
  • Loading branch information
intelfx committed Jul 31, 2018
1 parent da10371 commit b8e79f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/drivers/none/none.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package none
import (
"bytes"
"fmt"
"os"
"os/exec"
"strings"

Expand All @@ -27,7 +28,6 @@ import (
"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/state"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/net"
pkgdrivers "k8s.io/minikube/pkg/drivers"
)

Expand Down Expand Up @@ -77,11 +77,11 @@ func (d *Driver) DriverName() string {
}

func (d *Driver) GetIP() (string, error) {
ip, err := net.ChooseBindAddress(nil)
if err != nil {
return "", err
if hostIP, ok := os.LookupEnv("MINIKUBE_IP"); ok {
return hostIP, nil
} else {
return "127.0.0.1", nil
}
return ip.String(), nil
}

func (d *Driver) GetSSHHostname() (string, error) {
Expand Down

0 comments on commit b8e79f7

Please sign in to comment.