mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #97403 from abelbarrera15/mem-32-bit-req-bug
32bit > 4GB integer overflow edge case fix
This commit is contained in:
commit
32093b0447
@ -51,8 +51,8 @@ func (mc MemCheck) Check() (warnings, errorList []error) {
|
||||
errorList = append(errorList, errors.Wrapf(err, "failed to get system info"))
|
||||
}
|
||||
|
||||
// Totalram returns bytes; convert to MB
|
||||
actual := uint64(info.Totalram) / 1024 / 1024
|
||||
// Totalram holds the total usable memory. Unit holds the size of a memory unit in bytes. Multiply them and convert to MB
|
||||
actual := uint64(info.Totalram) * uint64(info.Unit) / 1024 / 1024
|
||||
if actual < mc.Mem {
|
||||
errorList = append(errorList, errors.Errorf("the system RAM (%d MB) is less than the minimum %d MB", actual, mc.Mem))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user