Skip to content

Commit

Permalink
feat: make wait-for-cluster more robust (#676)
Browse files Browse the repository at this point in the history
The status is PROVISIONING at the beginning, thus the original logic will always exit and say "Cluster is ready!". If we wait for the RUNNING status, we will know for sure the cluster is up.

Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com>
  • Loading branch information
MrBlaise and bharathkkb committed Sep 19, 2020
1 parent 9f84cec commit dffb047
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion autogen/main/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)")
[[ "${current_status}" == "RECONCILING" ]]
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

echo "Cluster is ready!"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)")
[[ "${current_status}" == "RECONCILING" ]]
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

echo "Cluster is ready!"
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)")
[[ "${current_status}" == "RECONCILING" ]]
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

echo "Cluster is ready!"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)")
[[ "${current_status}" == "RECONCILING" ]]
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

echo "Cluster is ready!"
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)")
[[ "${current_status}" == "RECONCILING" ]]
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

echo "Cluster is ready!"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)")
[[ "${current_status}" == "RECONCILING" ]]
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

echo "Cluster is ready!"
2 changes: 1 addition & 1 deletion modules/private-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)")
[[ "${current_status}" == "RECONCILING" ]]
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

echo "Cluster is ready!"
2 changes: 1 addition & 1 deletion scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)")
[[ "${current_status}" == "RECONCILING" ]]
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

echo "Cluster is ready!"

0 comments on commit dffb047

Please sign in to comment.