Properly support the "minikube-net" network.

pull/2320/head
dlorenc 2017-12-12 11:57:15 -08:00 committed by dlorenc
parent b2251409ce
commit 8f91c37bba
5 changed files with 31 additions and 8 deletions

View File

@ -36,7 +36,7 @@ set -e
gsutil cp gs://minikube-builds/logs/index.html gs://minikube-builds/logs/${ghprbPullId}/index.html
# Exit if the cross build failed.
if [ "$?"-ne 0]; then echo "cross build failed"; exit 1; fi
if [ "$?"-ne 0 ]; then echo "cross build failed"; exit 1; fi
# If there are ISO changes, build and upload the ISO
# then set the default to the newly built ISO for testing

View File

@ -34,11 +34,6 @@ import (
pkgdrivers "k8s.io/minikube/pkg/drivers"
)
const (
qemusystem = "qemu:///system"
defaultPrivateNetworkName = "minikube-net"
)
type Driver struct {
*drivers.BaseDriver
*pkgdrivers.CommonDriver
@ -72,7 +67,11 @@ type Driver struct {
MAC string
}
const defaultNetworkName = "minikube-net"
const (
qemusystem = "qemu:///system"
defaultPrivateNetworkName = "minikube-net"
defaultNetworkName = "default"
)
func NewDriver(hostName, storePath string) *Driver {
return &Driver{

View File

@ -216,7 +216,7 @@ func createHost(api libmachine.API, config MachineConfig) (*host.Host, error) {
}
driver = createKVMHost(config)
case "kvm2":
driver = createKVMHost(config)
driver = createKVM2Host(config)
case "xhyve":
if viper.GetBool(cfg.ShowDriverDeprecationNotification) {
fmt.Fprintln(os.Stderr, `WARNING: The xhyve driver is now deprecated and support for it will be removed in a future release.

View File

@ -62,6 +62,26 @@ func createKVMHost(config MachineConfig) *kvmDriver {
}
}
func createKVM2Host(config MachineConfig) *kvmDriver {
return &kvmDriver{
BaseDriver: &drivers.BaseDriver{
MachineName: cfg.GetMachineName(),
StorePath: constants.GetMinipath(),
SSHUser: "docker",
},
Memory: config.Memory,
CPU: config.CPUs,
Network: config.KvmNetwork,
PrivateNetwork: "minikube-net",
Boot2DockerURL: config.Downloader.GetISOFileURI(config.MinikubeISO),
DiskSize: config.DiskSize,
DiskPath: filepath.Join(constants.GetMinipath(), "machines", cfg.GetMachineName(), fmt.Sprintf("%s.rawdisk", cfg.GetMachineName())),
ISO: filepath.Join(constants.GetMinipath(), "machines", cfg.GetMachineName(), "boot2docker.iso"),
CacheMode: "default",
IOMode: "threads",
}
}
func detectVBoxManageCmd() string {
cmd := "VBoxManage"
if path, err := exec.LookPath(cmd); err == nil {

View File

@ -24,6 +24,10 @@ func createKVMHost(config MachineConfig) drivers.Driver {
panic("kvm not supported")
}
func createKVM2Host(config MachineConfig) drivers.Driver {
panic("kvm2 not supported")
}
func createNoneHost(config MachineConfig) drivers.Driver {
panic("no-vm not supported")
}