diff --git a/cmd/minikube/cmd/root.go b/cmd/minikube/cmd/root.go index 1518988cfa12..0c2b5fba62ed 100644 --- a/cmd/minikube/cmd/root.go +++ b/cmd/minikube/cmd/root.go @@ -33,7 +33,6 @@ import ( "k8s.io/minikube/cmd/util" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" - "k8s.io/minikube/pkg/minikube/machine" "k8s.io/minikube/pkg/minikube/notify" ) @@ -56,7 +55,6 @@ const ( var ( enableUpdateNotification = true - clientType machine.ClientType ) var viperWhiteList = []string{ diff --git a/pkg/minikube/machine/client.go b/pkg/minikube/machine/client.go index 27f38433f51d..34e578d122d2 100644 --- a/pkg/minikube/machine/client.go +++ b/pkg/minikube/machine/client.go @@ -49,25 +49,7 @@ import ( type driverGetter func([]byte) (drivers.Driver, error) -type ClientType int -type clientFactory interface { - NewClient(string, string) libmachine.API -} - -type localClientFactory struct{} - -func (*localClientFactory) NewClient(storePath, certsDir string) libmachine.API { - return &LocalClient{ - certsDir: certsDir, - storePath: storePath, - Filestore: persist.NewFilestore(storePath, certsDir, certsDir), - legacyClient: (&rpcClientFactory{}).NewClient(storePath, certsDir), - } -} - -type rpcClientFactory struct{} - -func (*rpcClientFactory) NewClient(storePath, certsDir string) libmachine.API { +func NewRPCClient(storePath, certsDir string) libmachine.API { c := libmachine.NewClient(storePath, certsDir) c.SSHClientType = ssh.Native return c @@ -82,7 +64,7 @@ func NewAPIClient() (libmachine.API, error) { certsDir: certsDir, storePath: storePath, Filestore: persist.NewFilestore(storePath, certsDir, certsDir), - legacyClient: (&rpcClientFactory{}).NewClient(storePath, certsDir), + legacyClient: NewRPCClient(storePath, certsDir), }, nil } diff --git a/pkg/minikube/machine/client_darwin.go b/pkg/minikube/machine/client_darwin.go index a5e6371271f4..04dfbc85b38d 100644 --- a/pkg/minikube/machine/client_darwin.go +++ b/pkg/minikube/machine/client_darwin.go @@ -29,7 +29,6 @@ import ( var driverMap = map[string]driverGetter{ "vmwarefusion": getVMWareFusionDriver, - "xhyve": getXhyveDriver, "virtualbox": getVirtualboxDriver, } diff --git a/pkg/minikube/machine/client_linux.go b/pkg/minikube/machine/client_linux.go index b32e730c0743..91bf179689ae 100644 --- a/pkg/minikube/machine/client_linux.go +++ b/pkg/minikube/machine/client_linux.go @@ -28,18 +28,10 @@ import ( ) var driverMap = map[string]driverGetter{ - "kvm": getKVMDriver, "virtualbox": getVirtualboxDriver, "none": getNoneDriver, } -func getKVMDriver(rawDriver []byte) (drivers.Driver, error) { - return nil, errors.New(` -The KVM driver is not included in minikube yet. Please follow the direction at -https://github.com/kubernetes/minikube/blob/master/DRIVERS.md#kvm-driver -`) -} - func getNoneDriver(rawDriver []byte) (drivers.Driver, error) { var driver drivers.Driver driver = &none.Driver{} diff --git a/pkg/minikube/machine/client_test.go b/pkg/minikube/machine/client_test.go index b7a1eca6abd4..9e69bda225b6 100644 --- a/pkg/minikube/machine/client_test.go +++ b/pkg/minikube/machine/client_test.go @@ -116,7 +116,10 @@ func TestGetDriver(t *testing.T) { } func TestLocalClientNewHost(t *testing.T) { - c := (&localClientFactory{}).NewClient("", "") + c, err := NewAPIClient() + if err != nil { + t.Fatal(err) + } var tests = []struct { description string