From 35bf0fc0b74cf6fc0d8d1358ca8692f269362c20 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Wed, 18 Jun 2014 10:54:23 -0700 Subject: [PATCH] Add a version check for go. --- hack/config-go.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hack/config-go.sh b/hack/config-go.sh index de3b43e7c09..197e4fac116 100755 --- a/hack/config-go.sh +++ b/hack/config-go.sh @@ -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"