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

Minimum CPUs check #5086

Merged
merged 4 commits into from
Sep 5, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixed counting of physical CPU cores
Gopsutil packae doesn't automatically return a count of CPU cores, have to use
the Counts function.
  • Loading branch information
MaxKam committed Sep 2, 2019
commit 68f8dca51a0229c921873a0e35808dbf952879c9
8 changes: 5 additions & 3 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
@@ -575,12 +575,14 @@ func validateConfig() {
out.V{"memory": memorySizeMB, "default_memorysize": pkgutil.CalculateSizeInMB(constants.DefaultMemorySize)})
}

var cpuCount int
if viper.GetString(vmDriver) == constants.DriverNone {
ci, err := cpu.Info()
// Uses the gopsutil cpu package to count the number of physical cpu cores
ci, err := cpu.Counts(false)
if err != nil {
glog.Warningf("Unable to get CPU info: $v", err)
glog.Warningf("Unable to get CPU info: %v", err)
} else {
cpuCount = ci.Cores
cpuCount = ci
}
} else {
cpuCount = viper.GetInt(cpus)