Add a version check for go.

pull/6/head
Brendan Burns 2014-06-18 10:54:23 -07:00
parent f57ae2f4bf
commit 35bf0fc0b7
1 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,20 @@ if [ "$(which go)" == "" ]; then
exit 1
fi
# Travis continuous build uses a head go release that doesn't report
# a version number, so we skip this check on Travis. Its unnecessary
# there anyway.
if [ ${TRAVIS} != "true" ]; then
GO_VERSION=($(go version))
if [ ${GO_VERSION[2]} \< "go1.2" ]; then
echo "Detected go version: ${GO_VERSION}."
echo "Kubernetes requires go version 1.2 or greater."
echo "Please install Go version 1.2 or later"
exit 1
fi
fi
pushd $(dirname "${BASH_SOURCE}")/.. >/dev/null
KUBE_REPO_ROOT="${PWD}"
KUBE_TARGET="${KUBE_REPO_ROOT}/output/go"