Repository: kubernetes/minikube
Pull request #16670 (2023-06-11 11:50:29)

Remove the obsolete vmwarefusion driver
It just referred to the "vmware" driver (and errored)

Remove it, so we don't need to see it in the refactor.

k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes/minikube/pull/16670#" title="Author self-approved">afbjorklund</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes%2Fminikube).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes/minikube/blob/master/OWNERS)~~ [afbjorklund]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/pkg/minikube/driver/driver.go b/pkg/minikube/driver/driver.go
index 40901c6e1..21928e7fa 100644
--- a/pkg/minikube/driver/driver.go
+++ b/pkg/minikube/driver/driver.go
@@ -56,8 +56,6 @@ const (
 	HyperKit = "hyperkit"
 	// VMware driver
 	VMware = "vmware"
-	// VMwareFusion driver (obsolete)
-	VMwareFusion = "vmwarefusion"
 	// HyperV driver
 	HyperV = "hyperv"
 	// Parallels driver
diff --git a/pkg/minikube/driver/driver_darwin.go b/pkg/minikube/driver/driver_darwin.go
index cfeba75bb..d2588f469 100644
--- a/pkg/minikube/driver/driver_darwin.go
+++ b/pkg/minikube/driver/driver_darwin.go
@@ -38,7 +38,6 @@ var supportedDrivers = func() []string {
 		return []string{
 			VirtualBox,
 			Parallels,
-			VMwareFusion,
 			HyperKit,
 			VMware,
 			Docker,
@@ -48,7 +47,6 @@ var supportedDrivers = func() []string {
 	return []string{
 		VirtualBox,
 		Parallels,
-		VMwareFusion,
 		HyperKit,
 		VMware,
 		QEMU2,
diff --git a/pkg/minikube/driver/driver_linux.go b/pkg/minikube/driver/driver_linux.go
index e12c23d70..613effa2a 100644
--- a/pkg/minikube/driver/driver_linux.go
+++ b/pkg/minikube/driver/driver_linux.go
@@ -23,7 +23,6 @@ import (
 // supportedDrivers is a list of supported drivers on Linux.
 var supportedDrivers = []string{
 	VirtualBox,
-	VMwareFusion,
 	KVM2,
 	QEMU2,
 	QEMU,
diff --git a/pkg/minikube/driver/driver_windows.go b/pkg/minikube/driver/driver_windows.go
index 51defd622..255d28a0f 100644
--- a/pkg/minikube/driver/driver_windows.go
+++ b/pkg/minikube/driver/driver_windows.go
@@ -29,7 +29,6 @@ import (
 // supportedDrivers is a list of supported drivers on Windows.
 var supportedDrivers = []string{
 	VirtualBox,
-	VMwareFusion,
 	HyperV,
 	VMware,
 	QEMU2,
diff --git a/pkg/minikube/machine/fix.go b/pkg/minikube/machine/fix.go
index 4d96fbd0f..3db7e4110 100644
--- a/pkg/minikube/machine/fix.go
+++ b/pkg/minikube/machine/fix.go
@@ -284,8 +284,6 @@ func machineExists(d string, s state.State, err error) (bool, error) {
 		return machineExistsError(s, err, virtualbox.ErrMachineNotExist)
 	case driver.VMware:
 		return machineExistsState(s, err)
-	case driver.VMwareFusion:
-		return machineExistsState(s, err)
 	case driver.Docker:
 		return machineExistsDocker(s, err)
 	case driver.Mock:
diff --git a/pkg/minikube/registry/drvs/init.go b/pkg/minikube/registry/drvs/init.go
index 78bb3e663..63a7f2912 100644
--- a/pkg/minikube/registry/drvs/init.go
+++ b/pkg/minikube/registry/drvs/init.go
@@ -29,5 +29,4 @@ import (
 	_ "k8s.io/minikube/pkg/minikube/registry/drvs/ssh"
 	_ "k8s.io/minikube/pkg/minikube/registry/drvs/virtualbox"
 	_ "k8s.io/minikube/pkg/minikube/registry/drvs/vmware"
-	_ "k8s.io/minikube/pkg/minikube/registry/drvs/vmwarefusion"
 )
diff --git a/pkg/minikube/registry/drvs/vmwarefusion/doc.go b/pkg/minikube/registry/drvs/vmwarefusion/doc.go
deleted file mode 100644
index 69b2b8f8d..000000000
--- a/pkg/minikube/registry/drvs/vmwarefusion/doc.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-Copyright 2018 The Kubernetes Authors All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package vmwarefusion
diff --git a/pkg/minikube/registry/drvs/vmwarefusion/vmwarefusion.go b/pkg/minikube/registry/drvs/vmwarefusion/vmwarefusion.go
deleted file mode 100644
index 0beb93ca8..000000000
--- a/pkg/minikube/registry/drvs/vmwarefusion/vmwarefusion.go
+++ /dev/null
@@ -1,46 +0,0 @@
-//go:build darwin
-
-/*
-Copyright 2018 The Kubernetes Authors All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// vmwarefusion contains a shell of the deprecated vmware vdriver
-package vmwarefusion
-
-import (
-	"fmt"
-
-	"k8s.io/minikube/pkg/minikube/driver"
-	"k8s.io/minikube/pkg/minikube/registry"
-)
-
-func init() {
-	if err := registry.Register(registry.DriverDef{
-		Name:     driver.VMwareFusion,
-		Status:   status,
-		Default:  false, // see driver.VMware instead
-		Priority: registry.Obsolete,
-	}); err != nil {
-		panic(fmt.Sprintf("register: %v", err))
-	}
-}
-
-func status() registry.State {
-	return registry.State{
-		Error: fmt.Errorf("the 'vmwarefusion' driver is no longer available"),
-		Fix:   "Switch to the newer 'vmware' driver by using '--driver=vmware'. This may require first deleting your existing cluster",
-		Doc:   "https://minikube.sigs.k8s.io/docs/drivers/vmware/",
-	}
-}
diff --git a/site/content/en/docs/contrib/drivers.en.md b/site/content/en/docs/contrib/drivers.en.md
index 753bc9aaa..0f472ce0f 100644
--- a/site/content/en/docs/contrib/drivers.en.md
+++ b/site/content/en/docs/contrib/drivers.en.md
@@ -55,51 +55,4 @@ on your `$USER/.minikube` directory. Most likely the driver config is the driver
 
 - DriverCreator: Only needed when driver is builtin, to instantiate the driver instance.
 
-## Integration example: vmwarefusion
-
-All drivers are located in `k8s.io/minikube/pkg/minikube/drivers`. Take `vmwarefusion` as an example:
-
-```golang
-// +build darwin
-
-package vmwarefusion
-
-import (
-    "github.com/docker/machine/drivers/vmwarefusion"
-    "github.com/docker/machine/libmachine/drivers"
-    cfg "k8s.io/minikube/pkg/minikube/config"
-    "k8s.io/minikube/pkg/minikube/constants"
-    "k8s.io/minikube/pkg/minikube/localpath"
-    "k8s.io/minikube/pkg/minikube/registry"
-)
-
-func init() {
-    registry.Register(registry.DriverDef{
-        Name:          "vmwarefusion",
-        Builtin:       true,
-        ConfigCreator: createVMwareFusionHost,
-        DriverCreator: func() drivers.Driver {
-            return vmwarefusion.NewDriver("", "")
-        },
-    })
-}
-
-func createVMwareFusionHost(config cfg.ClusterConfig) interface{} {
-    d := vmwarefusion.NewDriver(config.Name, localpath.MiniPath()).(*vmwarefusion.Driver)
-    d.Boot2DockerURL = download.LocalISOResource(config.MinikubeISO)
-    d.Memory = config.Memory
-    d.CPU = config.CPUs
-    d.DiskSize = config.DiskSize
-    d.SSHPort = 22
-    d.ISO = d.ResolveStorePath("boot2docker.iso")
-    return d
-}
-```
-
-- Within the `init()` function, register a `DriverDef` in registry. Specify the metadata in the `DriverDef`. As mentioned
-earlier, it's builtin, so you also need to specify `DriverCreator` to tell minikube how to create a `drivers.Driver`.
-- Another important thing is `vmwarefusion` only runs on MacOS. You need to add a build tag on top so it only
-runs on MacOS, so that the releases on Windows and Linux won't have this driver in registry.
-- Last but not least, import the driver in `pkg/minikube/cluster/default_drivers.go` to include it in build.
-
 Any Questions: please ping your friend [@anfernee](https://github.com/anfernee) or the #minikube Slack channel.


Test patch:
diff --git a/cmd/minikube/cmd/start_test.go b/cmd/minikube/cmd/start_test.go
index 434187b4f..d05e91ed8 100644
--- a/cmd/minikube/cmd/start_test.go
+++ b/cmd/minikube/cmd/start_test.go
@@ -323,7 +323,6 @@ func TestBaseImageFlagDriverCombo(t *testing.T) {
 		{driver.VirtualBox, false},
 		{driver.HyperKit, false},
 		{driver.VMware, false},
-		{driver.VMwareFusion, false},
 		{driver.HyperV, false},
 		{driver.Parallels, false},
 		{"something_invalid", false},
diff --git a/pkg/minikube/driver/driver_test.go b/pkg/minikube/driver/driver_test.go
index 7c0d09736..03528bb12 100644
--- a/pkg/minikube/driver/driver_test.go
+++ b/pkg/minikube/driver/driver_test.go
@@ -60,20 +60,19 @@ func TestBareMetal(t *testing.T) {
 
 func TestMachineType(t *testing.T) {
 	types := map[string]string{
-		Podman:       "container",
-		Docker:       "container",
-		Mock:         "bare metal machine",
-		None:         "bare metal machine",
-		SSH:          "bare metal machine",
-		KVM2:         "VM",
-		QEMU2:        "VM",
-		QEMU:         "VM",
-		VirtualBox:   "VM",
-		HyperKit:     "VM",
-		VMware:       "VM",
-		VMwareFusion: "VM",
-		HyperV:       "VM",
-		Parallels:    "VM",
+		Podman:     "container",
+		Docker:     "container",
+		Mock:       "bare metal machine",
+		None:       "bare metal machine",
+		SSH:        "bare metal machine",
+		KVM2:       "VM",
+		QEMU2:      "VM",
+		QEMU:       "VM",
+		VirtualBox: "VM",
+		HyperKit:   "VM",
+		VMware:     "VM",
+		HyperV:     "VM",
+		Parallels:  "VM",
 	}
 
 	drivers := SupportedDrivers()