From 5487a3f8f6e53246e78e3f48e0b63d07300f824b Mon Sep 17 00:00:00 2001 From: Jeff Grafton Date: Tue, 26 Apr 2016 17:41:15 -0700 Subject: [PATCH] Fix detect-node-names to not error out if there are no nodes --- cluster/gce/util.sh | 7 ++----- cluster/gke/util.sh | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 345a657ec1f..8e9dba1ee3f 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -284,12 +284,9 @@ function detect-node-names { "${group}" --zone "${ZONE}" --project "${PROJECT}" \ --format='value(instance)')) done - echo "INSTANCE_GROUPS=${INSTANCE_GROUPS[*]}" >&2 - echo "NODE_NAMES=${NODE_NAMES[*]}" >&2 - else - echo "INSTANCE_GROUPS=" >&2 - echo "NODE_NAMES=" >&2 fi + echo "INSTANCE_GROUPS=${INSTANCE_GROUPS[*]:-}" >&2 + echo "NODE_NAMES=${NODE_NAMES[*]:-}" >&2 } # Detect the information about the minions diff --git a/cluster/gke/util.sh b/cluster/gke/util.sh index df7d8da5ee3..97d17e15b81 100755 --- a/cluster/gke/util.sh +++ b/cluster/gke/util.sh @@ -251,7 +251,7 @@ function detect-node-names { "${NODE_INSTANCE_GROUP}" --zone "${ZONE}" --project "${PROJECT}" \ --format='value(instance)')) - echo "NODE_NAMES=${NODE_NAMES[*]}" + echo "NODE_NAMES=${NODE_NAMES[*]:-}" } # Detect instance group name generated by gke.