Add condition to check --cpus count with available cpu count
parent
bdd1e6de6a
commit
cc2bf6aa15
cmd/minikube/cmd
|
@ -995,7 +995,7 @@ func validateRequestedMemorySize(req int, drvName string) {
|
|||
}
|
||||
}
|
||||
|
||||
// validateCPUCount validates the cpu count matches the minimum recommended
|
||||
// validateCPUCount validates the cpu count matches the minimum recommended & not exceeding the available cpu count
|
||||
func validateCPUCount(drvName string) {
|
||||
var cpuCount int
|
||||
if driver.BareMetal(drvName) {
|
||||
|
@ -1029,6 +1029,10 @@ func validateCPUCount(drvName string) {
|
|||
|
||||
}
|
||||
|
||||
if si.CPUs < cpuCount {
|
||||
exitIfNotForced(reason.RsrcInsufficientCores, "Requested cpu count {{.requested_cpus}} is greater than the available cpus of {{.avail_cpus}}", out.V{"requested_cpus": cpuCount, "avail_cpus": si.CPUs})
|
||||
}
|
||||
|
||||
// looks good
|
||||
if si.CPUs >= 2 {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue