Remove the obsolete vmwarefusion driver

It just referred to the "vmware" driver
pull/16670/head
Anders F Björklund 2023-06-11 13:47:05 +02:00
parent 45db573aec
commit 0a551357b4
11 changed files with 13 additions and 134 deletions

View File

@ -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},

View File

@ -56,8 +56,6 @@ const (
HyperKit = "hyperkit"
// VMware driver
VMware = "vmware"
// VMwareFusion driver (obsolete)
VMwareFusion = "vmwarefusion"
// HyperV driver
HyperV = "hyperv"
// Parallels driver

View File

@ -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,

View File

@ -23,7 +23,6 @@ import (
// supportedDrivers is a list of supported drivers on Linux.
var supportedDrivers = []string{
VirtualBox,
VMwareFusion,
KVM2,
QEMU2,
QEMU,

View File

@ -71,7 +71,6 @@ func TestMachineType(t *testing.T) {
VirtualBox: "VM",
HyperKit: "VM",
VMware: "VM",
VMwareFusion: "VM",
HyperV: "VM",
Parallels: "VM",
}

View File

@ -29,7 +29,6 @@ import (
// supportedDrivers is a list of supported drivers on Windows.
var supportedDrivers = []string{
VirtualBox,
VMwareFusion,
HyperV,
VMware,
QEMU2,

View File

@ -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:

View File

@ -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"
)

View File

@ -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

View File

@ -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/",
}
}

View File

@ -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.