Skip to content

Commit

Permalink
Merge pull request #9958 from tstromberg/vmwarefusion
Browse files Browse the repository at this point in the history
Remove obsolete 'vmwarefusion' driver, add friendly message
  • Loading branch information
medyagh authored Dec 23, 2020
2 parents e678fb1 + e5f06a1 commit f680057
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 36 deletions.
10 changes: 10 additions & 0 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const (
HyperKit = "hyperkit"
// VMware driver
VMware = "vmware"
// VMwareFusion driver
// VMwareFusion driver (obsolete)
VMwareFusion = "vmwarefusion"
// HyperV driver
HyperV = "hyperv"
Expand Down
7 changes: 0 additions & 7 deletions pkg/minikube/machine/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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() {
Expand Down
34 changes: 6 additions & 28 deletions pkg/minikube/registry/drvs/vmwarefusion/vmwarefusion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
2 changes: 2 additions & 0 deletions pkg/minikube/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f680057

Please sign in to comment.