Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wait-for-cluster fallback filter to name if location is not set #736

Merged
merged 1 commit into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion autogen/main/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ IMPERSONATE_SERVICE_ACCOUNT=$4
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
# if cluster location is set, use it in filter
if [ -z "${CLUSTER_LOCATION}" ]; then
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
else
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
fi
if [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ IMPERSONATE_SERVICE_ACCOUNT=$4
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
# if cluster location is set, use it in filter
if [ -z "${CLUSTER_LOCATION}" ]; then
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
else
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
fi
if [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
Expand Down
7 changes: 6 additions & 1 deletion modules/beta-private-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ IMPERSONATE_SERVICE_ACCOUNT=$4
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
# if cluster location is set, use it in filter
if [ -z "${CLUSTER_LOCATION}" ]; then
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
else
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
fi
if [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ IMPERSONATE_SERVICE_ACCOUNT=$4
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
# if cluster location is set, use it in filter
if [ -z "${CLUSTER_LOCATION}" ]; then
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
else
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
fi
if [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
Expand Down
7 changes: 6 additions & 1 deletion modules/beta-public-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ IMPERSONATE_SERVICE_ACCOUNT=$4
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
# if cluster location is set, use it in filter
if [ -z "${CLUSTER_LOCATION}" ]; then
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
else
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
fi
if [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ IMPERSONATE_SERVICE_ACCOUNT=$4
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
# if cluster location is set, use it in filter
if [ -z "${CLUSTER_LOCATION}" ]; then
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
else
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
fi
if [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
Expand Down
7 changes: 6 additions & 1 deletion modules/private-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ IMPERSONATE_SERVICE_ACCOUNT=$4
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
# if cluster location is set, use it in filter
if [ -z "${CLUSTER_LOCATION}" ]; then
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
else
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
fi
if [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
Expand Down
7 changes: 6 additions & 1 deletion scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ IMPERSONATE_SERVICE_ACCOUNT=$4
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
# if cluster location is set, use it in filter
if [ -z "${CLUSTER_LOCATION}" ]; then
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
else
current_status=$(gcloud container clusters list --project="$PROJECT" --filter="name=$CLUSTER_NAME AND location=$CLUSTER_LOCATION" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
fi
if [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
Expand Down