Skip to content

Commit

Permalink
Merge pull request #4255 from ne0h/mount-vmware
Browse files Browse the repository at this point in the history
Return host IP when using vmware as vm driver.
  • Loading branch information
k8s-ci-robot authored May 15, 2019
2 parents 2a4270c + a711431 commit 867443c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/minikube/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@ func GetVMHostIP(host *host.Host) (net.IP, error) {
return ip, nil
case "xhyve", "hyperkit":
return net.ParseIP("192.168.64.1"), nil
case "vmware":
vmIPString, err := host.Driver.GetIP()
if err != nil {
return []byte{}, errors.Wrap(err, "Error getting VM IP address")
}
vmIP := net.ParseIP(vmIPString).To4()
if vmIP == nil {
return []byte{}, errors.Wrap(err, "Error converting VM IP address to IPv4 address")
}
return net.IPv4(vmIP[0], vmIP[1], vmIP[2], byte(1)), nil
default:
return []byte{}, errors.New("Error, attempted to get host ip address for unsupported driver")
}
Expand Down

0 comments on commit 867443c

Please sign in to comment.