From b114399511f8ade35e408dcadf2afcee4cf445fb Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Mon, 14 Dec 2020 10:55:20 -0800 Subject: [PATCH 1/2] Obsolete --- pkg/minikube/driver/driver.go | 2 +- pkg/minikube/registry/registry.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/minikube/driver/driver.go b/pkg/minikube/driver/driver.go index b890ce0e4500..49ad84d100e7 100644 --- a/pkg/minikube/driver/driver.go +++ b/pkg/minikube/driver/driver.go @@ -47,7 +47,7 @@ const ( HyperKit = "hyperkit" // VMware driver VMware = "vmware" - // VMwareFusion driver + // VMwareFusion driver (deprecated) VMwareFusion = "vmwarefusion" // HyperV driver HyperV = "hyperv" diff --git a/pkg/minikube/registry/registry.go b/pkg/minikube/registry/registry.go index 3cdc64414abc..65ccc57c4b85 100644 --- a/pkg/minikube/registry/registry.go +++ b/pkg/minikube/registry/registry.go @@ -31,6 +31,8 @@ type Priority int const ( // Unknown is when there is no status check available Unknown Priority = iota + // Obsolete is when a driver has been removed + Obsolete // Unhealthy is when a driver does not pass health checks Unhealthy // Experimental is when a driver is not officially supported because it's still experimental From e5f06a1f13fcb42778745fa99f752ef960832819 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Mon, 14 Dec 2020 11:10:43 -0800 Subject: [PATCH 2/2] Remove the vmwarefusion driver --- cmd/minikube/cmd/start.go | 10 ++++++ pkg/minikube/driver/driver.go | 2 +- pkg/minikube/machine/start.go | 7 ---- .../drvs/vmwarefusion/vmwarefusion.go | 34 ++++--------------- 4 files changed, 17 insertions(+), 36 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 5f3062b7704d..199c317f57fe 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -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 } diff --git a/pkg/minikube/driver/driver.go b/pkg/minikube/driver/driver.go index 49ad84d100e7..07974b9be132 100644 --- a/pkg/minikube/driver/driver.go +++ b/pkg/minikube/driver/driver.go @@ -47,7 +47,7 @@ const ( HyperKit = "hyperkit" // VMware driver VMware = "vmware" - // VMwareFusion driver (deprecated) + // VMwareFusion driver (obsolete) VMwareFusion = "vmwarefusion" // HyperV driver HyperV = "hyperv" diff --git a/pkg/minikube/machine/start.go b/pkg/minikube/machine/start.go index 9314ec703a4a..7e0c3d795ccd 100644 --- a/pkg/minikube/machine/start.go +++ b/pkg/minikube/machine/start.go @@ -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() { diff --git a/pkg/minikube/registry/drvs/vmwarefusion/vmwarefusion.go b/pkg/minikube/registry/drvs/vmwarefusion/vmwarefusion.go index b571113941be..1d3edb1a24e9 100644 --- a/pkg/minikube/registry/drvs/vmwarefusion/vmwarefusion.go +++ b/pkg/minikube/registry/drvs/vmwarefusion/vmwarefusion.go @@ -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} }