Add message to discourage the use of virtualbox driver

pull/11981/head
Devdutt Shenoi 2021-07-14 15:00:22 +05:30
parent 4c66799127
commit 0e665930e8
5 changed files with 25 additions and 0 deletions

View File

@ -126,6 +126,10 @@ var settings = []Setting{
name: config.WantNoneDriverWarning,
set: SetBool,
},
{
name: config.WantVirtualBoxDriverWarning,
set: SetBool,
},
{
name: config.ProfileName,
set: SetString,

View File

@ -305,6 +305,7 @@ func setupViper() {
viper.SetDefault(config.WantUpdateNotification, true)
viper.SetDefault(config.ReminderWaitPeriodInHours, 24)
viper.SetDefault(config.WantNoneDriverWarning, true)
viper.SetDefault(config.WantVirtualBoxDriverWarning, true)
}
func addToPath(dir string) {

View File

@ -38,6 +38,8 @@ const (
ReminderWaitPeriodInHours = "ReminderWaitPeriodInHours"
// WantNoneDriverWarning is the key for WantNoneDriverWarning
WantNoneDriverWarning = "WantNoneDriverWarning"
// WantVirtualBoxDriverWarning is the key for WantVirtualBoxDriverWarning
WantVirtualBoxDriverWarning = "WantVirtualBoxDriverWarning"
// ProfileName represents the key for the global profile parameter
ProfileName = "profile"
// UserFlag is the key for the global user flag (ex. --user=user1)

View File

@ -191,6 +191,23 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) {
go addons.Start(&wg, starter.Cfg, starter.ExistingAddons, addonList)
}
// discourage use of the virtualbox driver
if starter.Cfg.Driver == driver.VirtualBox && viper.GetBool(config.WantVirtualBoxDriverWarning) {
var altDriverList strings.Builder
for _, d := range driver.Choices(true) {
if d.Name != "virtualbox" {
altDriverList.WriteString(fmt.Sprintf("\t- %s\n", d.Name))
}
}
out.ErrT(style.Empty, "")
out.WarningT("The 'virtualbox' driver could be troublesome to work with, do not use if you aren't familiar with it")
out.ErrT(style.Tip, "You could instead use one of the drivers listed below:")
out.ErrT(style.Empty, altDriverList.String())
out.ErrT(style.Documentation, "For more information, see: https://minikube.sigs.k8s.io/docs/reference/drivers/virtualbox/")
out.ErrT(style.Empty, "")
}
if apiServer {
// special ops for none , like change minikube directory.
// multinode super doesn't work on the none driver

View File

@ -30,6 +30,7 @@ Configurable fields:
* WantBetaUpdateNotification
* ReminderWaitPeriodInHours
* WantNoneDriverWarning
* WantVirtualBoxDriverWarning
* profile
* bootstrapper
* insecure-registry