diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index d3c4f2c1f5cc..d954bf89c934 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -227,14 +227,14 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k mem := suggestMemoryAllocation(sysLimit, containerLimit, viper.GetInt(nodes)) if cmd.Flags().Changed(memory) { - mem, err := pkgutil.CalculateSizeInMB(viper.GetString(memory)) + var err error + mem, err = pkgutil.CalculateSizeInMB(viper.GetString(memory)) if err != nil { exit.WithCodeT(exit.Config, "Generate unable to parse memory '{{.memory}}': {{.error}}", out.V{"memory": viper.GetString(memory), "error": err}) } if driver.IsKIC(drvName) && mem > containerLimit { exit.UsageT("{{.driver_name}} has only {{.container_limit}}MB memory but you specified {{.specified_memory}}MB", out.V{"container_limit": containerLimit, "specified_memory": mem, "driver_name": driver.FullName(drvName)}) } - } else { validateMemorySize(mem, drvName) glog.Infof("Using suggested %dMB memory alloc based on sys=%dMB, container=%dMB", mem, sysLimit, containerLimit)