mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
fall back to old behavior when deciding mem availablity during build
This commit is contained in:
parent
643cb7a1c7
commit
0655e65b43
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user