Remove the vmwarefusion driver

pull/9958/head
Thomas Stromberg 2020-12-14 11:10:43 -08:00
parent b114399511
commit e5f06a1f13
4 changed files with 17 additions and 36 deletions

View File

@ -705,6 +705,16 @@ func validateDriver(ds registry.DriverState, existing *config.ClusterConfig) {
out.Step(style.Improvement, `For improved {{.driver}} performance, {{.fix}}`, out.V{"driver": driver.FullName(ds.Name), "fix": translate.T(st.Fix)})
}
if ds.Priority == registry.Obsolete {
exit.Message(reason.Kind{
ID: fmt.Sprintf("PROVIDER_%s_OBSOLETE", strings.ToUpper(name)),
Advice: translate.T(st.Fix),
ExitCode: reason.ExProviderUnsupported,
URL: st.Doc,
Style: style.Shrug,
}, st.Error.Error())
}
if st.Error == nil {
return
}

View File

@ -47,7 +47,7 @@ const (
HyperKit = "hyperkit"
// VMware driver
VMware = "vmware"
// VMwareFusion driver (deprecated)
// VMwareFusion driver (obsolete)
VMwareFusion = "vmwarefusion"
// HyperV driver
HyperV = "hyperv"

View File

@ -34,7 +34,6 @@ import (
"github.com/docker/machine/libmachine/host"
"github.com/juju/mutex"
"github.com/pkg/errors"
"github.com/spf13/viper"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/command"
@ -130,12 +129,6 @@ func createHost(api libmachine.API, cfg *config.ClusterConfig, n *config.Node) (
klog.Infof("duration metric: createHost completed in %s", time.Since(start))
}()
if cfg.Driver == driver.VMwareFusion && viper.GetBool(config.ShowDriverDeprecationNotification) {
out.WarningT(`The vmwarefusion driver is deprecated and support for it will be removed in a future release.
Please consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.
See https://minikube.sigs.k8s.io/docs/reference/drivers/vmware/ for more information.
To disable this message, run [minikube config set ShowDriverDeprecationNotification false]`)
}
showHostInfo(*cfg)
def := registry.Driver(cfg.Driver)
if def.Empty() {

View File

@ -16,52 +16,30 @@ 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"
"os/exec"
"github.com/docker/machine/drivers/vmwarefusion"
"github.com/docker/machine/libmachine/drivers"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/download"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/registry"
)
func init() {
if err := registry.Register(registry.DriverDef{
Name: driver.VMwareFusion,
Config: configure,
Status: status,
Init: func() drivers.Driver { return vmwarefusion.NewDriver("", "") },
Priority: registry.Deprecated,
Priority: registry.Obsolete,
}); err != nil {
panic(fmt.Sprintf("register: %v", err))
}
}
func configure(cfg config.ClusterConfig, n config.Node) (interface{}, error) {
d := vmwarefusion.NewDriver(driver.MachineName(cfg, n), localpath.MiniPath()).(*vmwarefusion.Driver)
d.Boot2DockerURL = download.LocalISOResource(cfg.MinikubeISO)
d.Memory = cfg.Memory
d.CPU = cfg.CPUs
d.DiskSize = cfg.DiskSize
// TODO(philips): push these defaults upstream to fixup this driver
d.SSHPort = 22
d.ISO = d.ResolveStorePath("boot2docker.iso")
return d, nil
}
func status() registry.State {
_, err := exec.LookPath("vmrun")
if err != nil {
return registry.State{Error: errors.Wrap(err, "vmrun path check"), Fix: "Install VMWare Fusion", Doc: "https://minikube.sigs.k8s.io/docs/reference/drivers/vmwarefusion/"}
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/",
}
return registry.State{Installed: true, Healthy: true}
}