Skip to content

Commit

Permalink
Fixed cluster validation: added -q and project flags to gcloud.
Browse files Browse the repository at this point in the history
Fixed cluster validation in multi-zone mode: added -q and project flags to gcloud.
  • Loading branch information
jszczepkowski committed Dec 22, 2016
1 parent 589c266 commit d80d59c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cluster/validate-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ ALLOWED_NOTREADY_NODES="${ALLOWED_NOTREADY_NODES:-0}"
CLUSTER_READY_ADDITIONAL_TIME_SECONDS="${CLUSTER_READY_ADDITIONAL_TIME_SECONDS:-30}"

EXPECTED_NUM_NODES="${NUM_NODES}"
if [[ "${KUBERNETES_PROVIDER:-}" == "gce" ]]; then
echo "Validating gce cluster, MULTIZONE=${MULTIZONE:-}"
# In multizone mode we need to add instances for all nodes in the region.
if [[ "${MULTIZONE:-}" == "true" ]]; then
EXPECTED_NUM_NODES=$(gcloud -q compute instances list --project="${PROJECT}" --format=[no-heading] --regexp="${NODE_INSTANCE_PREFIX}.*" \
--zones=$(gcloud -q compute zones list --project="${PROJECT}" --filter=region=${REGION} --format=[no-heading]\(name\) | tr "\n" "," | sed "s/,$//") | wc -l)
echo "Computing number of nodes, NODE_INSTANCE_PREFIX=${NODE_INSTANCE_PREFIX}, REGION=${REGION}, EXPECTED_NUM_NODES=${EXPECTED_NUM_NODES}"
fi
fi

if [[ "${REGISTER_MASTER_KUBELET:-}" == "true" ]]; then
if [[ "${KUBERNETES_PROVIDER:-}" == "gce" ]]; then
NUM_MASTERS=$(get-master-replicas-count)
Expand Down

0 comments on commit d80d59c

Please sign in to comment.