提交 0af762e5 编写于 作者: T tstromberg

none driver: Add warnings about --cpus, --memory, and --container-runtime

上级 a583cbec
......@@ -142,7 +142,6 @@ func init() {
if err := viper.BindPFlags(startCmd.Flags()); err != nil {
exit.WithError("unable to bind flags", err)
}
}
// initMinikubeFlags includes commandline flags for minikube.
......@@ -296,7 +295,7 @@ func runStart(cmd *cobra.Command, args []string) {
glog.Errorf("Error autoSetOptions : %v", err)
}
validateFlags(driverName)
validateFlags(cmd, driverName)
validateUser(driverName)
// No need to install a driver in download-only mode
......@@ -721,7 +720,7 @@ func validateUser(drvName string) {
}
// validateFlags validates the supplied flags against known bad combinations
func validateFlags(drvName string) {
func validateFlags(cmd *cobra.Command, drvName string) {
diskSizeMB := pkgutil.CalculateSizeInMB(viper.GetString(humanReadableDiskSize))
if diskSizeMB < pkgutil.CalculateSizeInMB(minimumDiskSize) && !viper.GetBool(force) {
exit.WithCodeT(exit.Config, "Requested disk size {{.requested_size}} is less than minimum of {{.minimum_size}}", out.V{"requested_size": diskSizeMB, "minimum_size": pkgutil.CalculateSizeInMB(minimumDiskSize)})
......@@ -742,6 +741,18 @@ func validateFlags(drvName string) {
exit.WithCodeT(exit.Config, "The 'none' driver does not support multiple profiles: https://minikube.sigs.k8s.io/docs/reference/drivers/none/")
}
if cmd.Flags().Changed(cpus) {
out.WarningT("The 'none' driver does not respect the --cpus flag")
}
if cmd.Flags().Changed(memory) {
out.WarningT("The 'none' driver does not respect the --memory flag")
}
runtime := viper.GetString(containerRuntime)
if runtime != "docker" {
out.WarningT("Using the '{{.runtime}}' runtime with the 'none' driver is an untested configuration!", out.V{"runtime": runtime})
}
// Uses the gopsutil cpu package to count the number of physical cpu cores
ci, err := cpu.Counts(false)
if err != nil {
......
......@@ -21,14 +21,11 @@ require (
github.com/docker/machine v0.7.1-0.20190718054102-a555e4f7a8f5 // version is 0.7.1 to pin to a555e4f7a8f5
github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f
github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/google/btree v1.0.0 // indirect
github.com/google/go-cmp v0.3.0
github.com/gorilla/mux v1.7.1 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.5.0 // indirect
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
github.com/hashicorp/go-getter v1.4.0
github.com/hashicorp/go-multierror v0.0.0-20160811015721-8c5f0ad93604 // indirect
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册