Add config to avoid warning about the none driver

Even when starting up minikube in a dedicated virtual machine,
there will be a warning against running it on your workstation.
pull/2338/merge
Anders F Björklund 2018-01-01 20:42:42 +01:00 committed by dlorenc
parent 59274b22da
commit 87f48f1731
5 changed files with 10 additions and 1 deletions

View File

@ -112,6 +112,10 @@ var settings = []Setting{
name: config.WantKubectlDownloadMsg,
set: SetBool,
},
{
name: config.WantNoneDriverWarning,
set: SetBool,
},
{
name: config.MachineProfile,
set: SetString,

View File

@ -162,6 +162,7 @@ func setupViper() {
viper.SetDefault(config.WantReportError, false)
viper.SetDefault(config.WantReportErrorPrompt, true)
viper.SetDefault(config.WantKubectlDownloadMsg, true)
viper.SetDefault(config.WantNoneDriverWarning, true)
viper.SetDefault(config.ShowDriverDeprecationNotification, true)
setFlagsUsingViper()
}

View File

@ -311,10 +311,12 @@ func runStart(cmd *cobra.Command, args []string) {
}
if config.VMDriver == "none" {
fmt.Println(`===================
if viper.GetBool(cfg.WantNoneDriverWarning) {
fmt.Println(`===================
WARNING: IT IS RECOMMENDED NOT TO RUN THE NONE DRIVER ON PERSONAL WORKSTATIONS
The 'none' driver will run an insecure kubernetes apiserver as root that may leave the host vulnerable to CSRF attacks
`)
}
if os.Getenv("CHANGE_MINIKUBE_NONE_USER") == "" {
fmt.Println(`When using the none driver, the kubectl config and credentials generated will be root owned and will appear in the root home directory.

View File

@ -14,6 +14,7 @@ Some features can only be accessed by environment variables, here is a list of t
* **MINIKUBE_WANTREPORTERRORPROMPT** - (bool) sets whether the user wants to be prompted on an error that they can report them to help improve minikube
* **MINIKUBE_WANTKUBECTLDOWNLOADMSG** - (bool) sets whether minikube should tell a user that `kubectl` cannot be found on there path
* **MINIKUBE_WANTNONEDRIVERWARNING** - (bool) sets whether minikube should warn a user about running the 'none' driver (CSRF attacks)
* **MINIKUBE_ENABLE_PROFILING** - (int, `1` enables it) enables trace profiling to be generated for minikube which can be analyzed via:

View File

@ -33,6 +33,7 @@ const (
WantReportError = "WantReportError"
WantReportErrorPrompt = "WantReportErrorPrompt"
WantKubectlDownloadMsg = "WantKubectlDownloadMsg"
WantNoneDriverWarning = "WantNoneDriverWarning"
MachineProfile = "profile"
ShowDriverDeprecationNotification = "ShowDriverDeprecationNotification"
)