From 7a6700275610950bd2cf8bb9d5343b688df50c09 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Wed, 19 Aug 2015 08:42:44 +0200 Subject: [PATCH 1/2] Stop using deprecated commands --- cluster/gce/util.sh | 6 +++--- cluster/gke/util.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 5a90a7d0c34..11bea167715 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -247,8 +247,8 @@ function upload-server-tars() { # MINION_NAMES function detect-minion-names { detect-project - MINION_NAMES=($(gcloud preview --project "${PROJECT}" instance-groups \ - --zone "${ZONE}" instances --group "${NODE_INSTANCE_PREFIX}-group" list \ + MINION_NAMES=($(gcloud compute instance-groups managed list-instances \ + "${NODE_INSTANCE_PREFIX}-group" --zone "${ZONE}" --project "${PROJECT}" \ | cut -d'/' -f11)) echo "MINION_NAMES=${MINION_NAMES[*]}" >&2 } @@ -764,7 +764,7 @@ function kube-down { # The gcloud APIs don't return machine parseable error codes/retry information. Therefore the best we can # do is parse the output and special case particular responses we are interested in. - if gcloud compute instance-groups managed describe --project "${PROJECT}" --zone "${ZONE}" "${NODE_INSTANCE_PREFIX}-group" &>/dev/null; then + if gcloud compute instance-groups managed describe "${NODE_INSTANCE_PREFIX}-group" --project "${PROJECT}" --zone "${ZONE}" &>/dev/null; then deleteCmdOutput=$(gcloud compute instance-groups managed delete --zone "${ZONE}" \ --project "${PROJECT}" \ --quiet \ diff --git a/cluster/gke/util.sh b/cluster/gke/util.sh index 6d4ea3a477d..d6e8e4e165c 100755 --- a/cluster/gke/util.sh +++ b/cluster/gke/util.sh @@ -243,8 +243,8 @@ function detect-minions() { function detect-minion-names { detect-project detect-node-instance-group - MINION_NAMES=($(gcloud preview --project "${PROJECT}" instance-groups \ - --zone "${ZONE}" instances --group "${NODE_INSTANCE_GROUP}" list \ + MINION_NAMES=($(gcloud compute instance-groups managed list-instances \ + "${NODE_INSTANCE_GROUP}" --zone "${ZONE}" --project "${PROJECT}" \ | cut -d'/' -f11)) echo "MINION_NAMES=${MINION_NAMES[*]}" } From 3082053f2fe45f9a97ca75c25dad3a240ac6e2fa Mon Sep 17 00:00:00 2001 From: Jeff Lowdermilk Date: Thu, 20 Aug 2015 17:00:05 -0700 Subject: [PATCH 2/2] Future-proof detect-minions for gke --- cluster/gke/util.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cluster/gke/util.sh b/cluster/gke/util.sh index d6e8e4e165c..ea15e7a279f 100755 --- a/cluster/gke/util.sh +++ b/cluster/gke/util.sh @@ -245,7 +245,8 @@ function detect-minion-names { detect-node-instance-group MINION_NAMES=($(gcloud compute instance-groups managed list-instances \ "${NODE_INSTANCE_GROUP}" --zone "${ZONE}" --project "${PROJECT}" \ - | cut -d'/' -f11)) + --format=yaml | grep instance: | cut -d ' ' -f 2)) + echo "MINION_NAMES=${MINION_NAMES[*]}" }