From b3ce311fd8ec8a4d0b518aad4e9202342665dacd Mon Sep 17 00:00:00 2001 From: Zach Loafman Date: Sun, 21 Dec 2014 08:03:49 -0800 Subject: [PATCH] Fix binary detection on GKE * kubectl is kubectl.sh in the e2es, so not needed in the path * Use the environment variable, and try to make sure the preview component is installed. --- cluster/gke/util.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cluster/gke/util.sh b/cluster/gke/util.sh index 7c6be3100e..d32b706527 100644 --- a/cluster/gke/util.sh +++ b/cluster/gke/util.sh @@ -69,16 +69,11 @@ function test-build-release() { # Verify needed binaries exist. function verify-prereqs() { echo "... in verify-prereqs()" >&2 - local cmd - # TODO(mbforbes): This assumes you have a "normal" gcloud installed even if - # you are setting one differently using ${GCLOUD}. - for cmd in gcloud kubectl; do - which "${cmd}" >/dev/null || { - echo "Can't find ${cmd} in PATH, please fix and retry. The Google Cloud " - echo "SDK can be downloaded from https://cloud.google.com/sdk/." - exit 1 - } - done + + ${GCLOUD} preview --help >/dev/null 2>&1 || { + echo "Either the GCLOUD environment variable is wrong, or the 'preview' component" + echo "is not installed. (Fix with 'gcloud components update preview')" + } } # Instantiate a kubernetes cluster