Skip to content

Commit c4663b8

Browse files
authored
Merge pull request #9181 from tstromberg/m1
Add Docker Desktop instructions if memory is >minimum but <recommended
2 parents a8d9535 + f15fd81 commit c4663b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,15 @@ func validateRequestedMemorySize(req int, drvName string) {
874874
exitIfNotForced(reason.RsrcInsufficientReqMemory, "Requested memory allocation {{.requested}}MiB is less than the usable minimum of {{.minimum_memory}}MB", out.V{"requested": req, "minimum_memory": minUsableMem})
875875
}
876876
if req < minRecommendedMem {
877-
out.WarnReason(reason.RsrcInsufficientReqMemory, "Requested memory allocation ({{.requested}}MB) is less than the recommended minimum {{.recommend}}MB. Deployments may fail.", out.V{"requested": req, "recommend": minRecommendedMem})
877+
if driver.IsDockerDesktop(drvName) {
878+
if runtime.GOOS == "darwin" {
879+
out.WarnReason(reason.RsrcInsufficientDarwinDockerMemory, "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.", out.V{"size": containerLimit, "req": minUsableMem, "recommend": "2.25 GB"})
880+
} else {
881+
out.WarnReason(reason.RsrcInsufficientWindowsDockerMemory, "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.", out.V{"size": containerLimit, "req": minUsableMem, "recommend": "2.25 GB"})
882+
}
883+
} else {
884+
out.WarnReason(reason.RsrcInsufficientReqMemory, "Requested memory allocation ({{.requested}}MB) is less than the recommended minimum {{.recommend}}MB. Deployments may fail.", out.V{"requested": req, "recommend": minRecommendedMem})
885+
}
878886
}
879887

880888
advised := suggestMemoryAllocation(sysLimit, containerLimit, viper.GetInt(nodes))

0 commit comments

Comments
 (0)