Commit f18cd536 authored by Joe Beda's avatar Joe Beda

Make dockerized build work when golang isn't installed.

parent ccc8bc82
...@@ -39,4 +39,4 @@ source "${KUBE_ROOT}/hack/lib/version.sh" ...@@ -39,4 +39,4 @@ source "${KUBE_ROOT}/hack/lib/version.sh"
source "${KUBE_ROOT}/hack/lib/golang.sh" source "${KUBE_ROOT}/hack/lib/golang.sh"
source "${KUBE_ROOT}/hack/lib/etcd.sh" source "${KUBE_ROOT}/hack/lib/etcd.sh"
KUBE_OUTPUT_HOSTBIN="${KUBE_OUTPUT_BINPATH}/$(kube::golang::host_platform)" KUBE_OUTPUT_HOSTBIN="${KUBE_OUTPUT_BINPATH}/$(kube::util::host_platform)"
...@@ -36,3 +36,46 @@ kube::util::wait_for_url() { ...@@ -36,3 +36,46 @@ kube::util::wait_for_url() {
kube::log::error "Timed out waiting for ${url}" kube::log::error "Timed out waiting for ${url}"
return 1 return 1
} }
# This figures out the host platform without relying on golang. We need this as
# we don't want a golang install to be a prerequisite to building yet we need
# this info to figure out where the final binaries are placed.
kube::util::host_platform() {
local host_os
local host_arch
case "$(uname -s)" in
Darwin)
host_os=darwin
;;
Linux)
host_os=linux
;;
*)
kube::log::error "Unsupported host OS. Must be Linux or Mac OS X."
exit 1
;;
esac
case "$(uname -m)" in
x86_64*)
host_arch=amd64
;;
i?86_64*)
host_arch=amd64
;;
amd64*)
host_arch=amd64
;;
arm*)
host_arch=arm
;;
i?86*)
host_arch=x86
;;
*)
kube::log::error "Unsupported host arch. Must be x86_64, 386 or arm."
exit 1
;;
esac
echo "${host_os}/${host_arch}"
}
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