Commit 0655e65b authored by Mike Danese's avatar Mike Danese

fall back to old behavior when deciding mem availablity during build

parent 643cb7a1
...@@ -421,12 +421,18 @@ kube::golang::build_binaries_for_platform() { ...@@ -421,12 +421,18 @@ kube::golang::build_binaries_for_platform() {
kube::golang::get_physmem() { kube::golang::get_physmem() {
local mem local mem
# Linux, in kb # Linux kernel version >=3.14, in kb
if mem=$(grep MemAvailable /proc/meminfo | awk '{ print $2 }'); then if mem=$(grep MemAvailable /proc/meminfo | awk '{ print $2 }'); then
echo $(( ${mem} / 1048576 )) echo $(( ${mem} / 1048576 ))
return return
fi 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 # 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 # run in a Linux container (because it's only used in the multiple
# platform case, which is a Dockerized build), but this is provided # platform case, which is a Dockerized build), but this is provided
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment