Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation notices for kvm and xhyve. #2227

Merged
merged 1 commit into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be good to allow a user to suppress these messages so we don't break any automated scripts? I think that was an issue with some of the other warning messages we've added. We might be able to reuse one of our env vars or config values for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see a topic in the docs related to kvm2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. We'll get that in today too.

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