Skip to content

Commit 6cde7c1

Browse files
committed
Fixed counting of physical CPU cores
Gopsutil packae doesn't automatically return a count of CPU cores, have to use the Counts function.
1 parent 2d763cf commit 6cde7c1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: cmd/minikube/cmd/start.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,14 @@ func validateConfig() {
539539
out.V{"memory": memorySizeMB, "default_memorysize": pkgutil.CalculateSizeInMB(constants.DefaultMemorySize)})
540540
}
541541

542+
var cpuCount int
542543
if viper.GetString(vmDriver) == constants.DriverNone {
543-
ci, err := cpu.Info()
544+
// Uses the gopsutil cpu package to count the number of physical cpu cores
545+
ci, err := cpu.Counts(false)
544546
if err != nil {
545-
glog.Warningf("Unable to get CPU info: $v", err)
547+
glog.Warningf("Unable to get CPU info: %v", err)
546548
} else {
547-
cpuCount = ci.Cores
549+
cpuCount = ci
548550
}
549551
} else {
550552
cpuCount = viper.GetInt(cpus)

0 commit comments

Comments
 (0)