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

memory field of the config file is broken #11012

Closed
saruman9 opened this issue Apr 7, 2021 · 2 comments · Fixed by #11014
Closed

memory field of the config file is broken #11012

saruman9 opened this issue Apr 7, 2021 · 2 comments · Fixed by #11014
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@saruman9
Copy link

saruman9 commented Apr 7, 2021

Steps to reproduce the issue:

  1. Set the memory field in the config file.
    $HOME/.minikube/config/config.json:
{
    "WantUpdateNotification": false,
    "cpus": 7,
    "disk-size": "300000",
    "driver": "kvm2",
    "memory": "12g"
}
  1. minikube start

Full output of minikube start command used, if not already included:

😄  minikube v1.17.1 on Arch
✨  Using the kvm2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating kvm2 VM (CPUs=7, Memory=3900MB, Disk=300000MB) ...
🐳  Preparing Kubernetes v1.20.2 on Docker 20.10.2 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

Similar issues: #9017, #9057.

@afbjorklund
Copy link
Collaborator

Confirm that only using the flags is working:

defaults

"Memory": 6000,
"CPUs": 2,
"DiskSize": 20000,

flags

--cpus 4 --memory 2g --disk-size 32g

"Memory": 2048,
"CPUs": 4,
"DiskSize": 32768,

config

- cpus: 4
- disk-size: 32g
- memory: 2g
"Memory": 6000,
"CPUs": 4,
"DiskSize": 32768,

So, something with "no existing cluster config was found, will generate one from the flags"

@afbjorklund afbjorklund added the kind/bug Categorizes issue or PR as related to a bug. label Apr 7, 2021
@afbjorklund
Copy link
Collaborator

The difference is in the "Flags().Changed":

		if cmd.Flags().Changed(memory) {
			var err error
			mem, err = pkgutil.CalculateSizeInMB(viper.GetString(memory))
			if err != nil {
				exit.Message(reason.Usage, "Generate unable to parse memory '{{.memory}}': {{.error}}", out.V{"memory": viper.GetString(memory), "error": err})
			}
		diskSize, err := pkgutil.CalculateSizeInMB(viper.GetString(humanReadableDiskSize))
		if err != nil {
			exit.Message(reason.Usage, "Generate unable to parse disk size '{{.diskSize}}': {{.error}}", out.V{"diskSize": viper.GetString(humanReadableDiskSize), "error": err})
		}

Apparently it does not respect the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants