Merge pull request #18025 from mikedanese/fixmem

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2015-12-01 12:10:34 -08:00
commit d282974e13

View File

@ -421,12 +421,18 @@ kube::golang::build_binaries_for_platform() {
kube::golang::get_physmem() {
local mem
# Linux, in kb
# Linux kernel version >=3.14, in kb
if mem=$(grep MemAvailable /proc/meminfo | awk '{ print $2 }'); then
echo $(( ${mem} / 1048576 ))
return
fi
# Linux, in kb
if mem=$(grep MemTotal /proc/meminfo | awk '{ print $2 }'); then
echo $(( ${mem} / 1048576 ))
return
fi
# OS X, in bytes. Note that get_physmem, as used, should only ever
# run in a Linux container (because it's only used in the multiple
# platform case, which is a Dockerized build), but this is provided