Skip to content

Commit

Permalink
GKE: Fix unbound variable when pd.sh fails
Browse files Browse the repository at this point in the history
In the other providers, MINION_NAMES is bound early and detect_minions
is actually only used to detect the IPs of the minions, which is why I
didn't expect to need to call it. Move the initialization to
config-common.sh in GKE as well.

This follows the pattern of cluster/gce/config-{default,test}.sh
  • Loading branch information
zmerlynn committed Jan 14, 2015
1 parent 21e81de commit 8cf9328
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions cluster/gke/config-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
MASTER_NAME="k8s-${CLUSTER_NAME}-master"
ZONE="${ZONE:-us-central1-f}"
NUM_MINIONS="${NUM_MINIONS:-2}"
MINION_NAMES=($(eval echo "k8s-${CLUSTER_NAME}-node-{1..${NUM_MINIONS}}"))
CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}"
# TODO(mbforbes): Actually plumb this through; this currently only works
# because we use the 'default' network by default.
Expand Down
7 changes: 1 addition & 6 deletions cluster/gke/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,9 @@ function detect-master() {
# NUM_MINIONS
# CLUSTER_NAME
# Vars set:
# MINION_NAMES (array)
# (none)
function detect-minions() {
echo "... in detect-minions()" >&2
# Just get the minion names.
MINION_NAMES=()
for (( i=1; i<=${NUM_MINIONS}; i++)); do
MINION_NAMES+=("k8s-${CLUSTER_NAME}-node-${i}")
done
}

# SSH to a node by name ($1) and run a command ($2).
Expand Down

0 comments on commit 8cf9328

Please sign in to comment.