Merge pull request #8833 from cjcullen/mig

Fix detect-minion-names for gke provider
This commit is contained in:
Saad Ali 2015-05-26 14:33:08 -07:00
commit 94e2192f2c
2 changed files with 8 additions and 10 deletions

View File

@ -21,7 +21,6 @@
MASTER_NAME="k8s-${CLUSTER_NAME}-master" MASTER_NAME="k8s-${CLUSTER_NAME}-master"
ZONE="${ZONE:-us-central1-f}" ZONE="${ZONE:-us-central1-f}"
NUM_MINIONS="${NUM_MINIONS:-2}" NUM_MINIONS="${NUM_MINIONS:-2}"
MINION_NAMES=($(eval echo "k8s-${CLUSTER_NAME}-node-{1..${NUM_MINIONS}}"))
CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}" CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}"
# TODO(mbforbes): Actually plumb this through; this currently only works # TODO(mbforbes): Actually plumb this through; this currently only works
# because we use the 'default' network by default. # because we use the 'default' network by default.

View File

@ -217,12 +217,12 @@ function detect-master() {
} }
# Assumed vars: # Assumed vars:
# NUM_MINIONS # none
# CLUSTER_NAME
# Vars set: # Vars set:
# (none) # MINION_NAMES
function detect-minions() { function detect-minions() {
echo "... in detect-minions()" >&2 echo "... in detect-minions()" >&2
detect-minion-names
} }
# Detect minions created in the minion group # Detect minions created in the minion group
@ -233,12 +233,11 @@ function detect-minions() {
# MINION_NAMES # MINION_NAMES
function detect-minion-names { function detect-minion-names {
detect-project detect-project
export MINION_NAMES="" GROUP_NAME=($(gcloud preview --project "${PROJECT}" instance-groups \
count=$("${GCLOUD}" alpha container clusters describe --project="${PROJECT}" --zone="${ZONE}" "${CLUSTER_NAME}" | grep numNodes | cut -f 2 -d ' ') --zone "${ZONE}" list | grep -o "k8s-${CLUSTER_NAME}-.\{8\}-group"))
for x in $(seq 1 $count); do MINION_NAMES=($(gcloud preview --project "${PROJECT}" instance-groups \
export MINION_NAMES="${MINION_NAMES} k8s-${CLUSTER_NAME}-node-${x} "; --zone "${ZONE}" instances --group "${GROUP_NAME}" list \
done | cut -d'/' -f11))
MINION_NAMES=(${MINION_NAMES})
echo "MINION_NAMES=${MINION_NAMES[*]}" echo "MINION_NAMES=${MINION_NAMES[*]}"
} }