Skip to content

Commit

Permalink
Add deprecation notices for kvm and xhyve.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlorenc committed Nov 29, 2017
1 parent e04c0d9 commit aa795de
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions cmd/minikube/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func setupViper() {
viper.SetDefault(config.WantReportError, false)
viper.SetDefault(config.WantReportErrorPrompt, true)
viper.SetDefault(config.WantKubectlDownloadMsg, true)
viper.SetDefault(config.ShowDriverDeprecationNotification, true)
setFlagsUsingViper()
}

Expand Down
17 changes: 16 additions & 1 deletion pkg/minikube/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/docker/machine/libmachine/state"
"github.com/golang/glog"
"github.com/pkg/errors"
"github.com/spf13/viper"

cfg "k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
Expand Down Expand Up @@ -206,9 +207,23 @@ func createHost(api libmachine.API, config MachineConfig) (*host.Host, error) {
driver = createVirtualboxHost(config)
case "vmwarefusion":
driver = createVMwareFusionHost(config)
case "kvm", "kvm2":
case "kvm":
if viper.GetBool(cfg.ShowDriverDeprecationNotification) {
fmt.Fprintln(os.Stderr, `WARNING: The kvm driver is now deprecated and support for it will be removed in a future release.
Please consider switching to the kvm2 driver, which is intended to replace the kvm driver.
See https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver for more information.
To disable this message, run [minikube config set WantShowDriverDeprecationNotification false]`)
}
driver = createKVMHost(config)
case "kvm2":
driver = createKVMHost(config)
case "xhyve":
if viper.GetBool(cfg.ShowDriverDeprecationNotification) {
fmt.Fprintln(os.Stderr, `WARNING: The xhyve driver is now deprecated and support for it will be removed in a future release.
Please consider switching to the hyperkit driver, which is intended to replace the xhyve driver.
See https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver for more information.
To disable this message, run [minikube config set WantShowDriverDeprecationNotification false]`)
}
driver = createXhyveHost(config)
case "hyperv":
driver = createHypervHost(config)
Expand Down
13 changes: 7 additions & 6 deletions pkg/minikube/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ import (
)

const (
WantUpdateNotification = "WantUpdateNotification"
ReminderWaitPeriodInHours = "ReminderWaitPeriodInHours"
WantReportError = "WantReportError"
WantReportErrorPrompt = "WantReportErrorPrompt"
WantKubectlDownloadMsg = "WantKubectlDownloadMsg"
MachineProfile = "profile"
WantUpdateNotification = "WantUpdateNotification"
ReminderWaitPeriodInHours = "ReminderWaitPeriodInHours"
WantReportError = "WantReportError"
WantReportErrorPrompt = "WantReportErrorPrompt"
WantKubectlDownloadMsg = "WantKubectlDownloadMsg"
MachineProfile = "profile"
ShowDriverDeprecationNotification = "ShowDriverDeprecationNotification"
)

type MinikubeConfig map[string]interface{}
Expand Down

0 comments on commit aa795de

Please sign in to comment.