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: multiple cluster wait-for-cluster.sh #734

Merged
merged 1 commit into from
Nov 3, 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
4 changes: 2 additions & 2 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,9 @@ module "gcloud_wait_for_cluster" {
upgrade = var.gcloud_upgrade

create_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
create_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
create_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"
destroy_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
destroy_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
destroy_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"

module_depends_on = concat(
[google_container_cluster.primary.master_version],
Expand Down
11 changes: 8 additions & 3 deletions autogen/main/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ fi

PROJECT=$1
CLUSTER_NAME=$2
IMPERSONATE_SERVICE_ACCOUNT=$3
CLUSTER_LOCATION=$3
IMPERSONATE_SERVICE_ACCOUNT=$4

echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
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 [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
fi
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

Expand Down
4 changes: 2 additions & 2 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ module "gcloud_wait_for_cluster" {
upgrade = var.gcloud_upgrade

create_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
create_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
create_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"
destroy_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
destroy_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
destroy_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"

module_depends_on = concat(
[google_container_cluster.primary.master_version],
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ module "gcloud_wait_for_cluster" {
upgrade = var.gcloud_upgrade

create_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
create_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
create_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"
destroy_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
destroy_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
destroy_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"

module_depends_on = concat(
[google_container_cluster.primary.master_version],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ fi

PROJECT=$1
CLUSTER_NAME=$2
IMPERSONATE_SERVICE_ACCOUNT=$3
CLUSTER_LOCATION=$3
IMPERSONATE_SERVICE_ACCOUNT=$4

echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
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 [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
fi
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

Expand Down
4 changes: 2 additions & 2 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ module "gcloud_wait_for_cluster" {
upgrade = var.gcloud_upgrade

create_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
create_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
create_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"
destroy_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
destroy_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
destroy_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"

module_depends_on = concat(
[google_container_cluster.primary.master_version],
Expand Down
11 changes: 8 additions & 3 deletions modules/beta-private-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ fi

PROJECT=$1
CLUSTER_NAME=$2
IMPERSONATE_SERVICE_ACCOUNT=$3
CLUSTER_LOCATION=$3
IMPERSONATE_SERVICE_ACCOUNT=$4

echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
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 [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
fi
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

Expand Down
4 changes: 2 additions & 2 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,9 @@ module "gcloud_wait_for_cluster" {
upgrade = var.gcloud_upgrade

create_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
create_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
create_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"
destroy_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
destroy_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
destroy_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"

module_depends_on = concat(
[google_container_cluster.primary.master_version],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ fi

PROJECT=$1
CLUSTER_NAME=$2
IMPERSONATE_SERVICE_ACCOUNT=$3
CLUSTER_LOCATION=$3
IMPERSONATE_SERVICE_ACCOUNT=$4

echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
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 [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
fi
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

Expand Down
4 changes: 2 additions & 2 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ module "gcloud_wait_for_cluster" {
upgrade = var.gcloud_upgrade

create_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
create_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
create_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"
destroy_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
destroy_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
destroy_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"

module_depends_on = concat(
[google_container_cluster.primary.master_version],
Expand Down
11 changes: 8 additions & 3 deletions modules/beta-public-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ fi

PROJECT=$1
CLUSTER_NAME=$2
IMPERSONATE_SERVICE_ACCOUNT=$3
CLUSTER_LOCATION=$3
IMPERSONATE_SERVICE_ACCOUNT=$4

echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
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 [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
fi
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

Expand Down
4 changes: 2 additions & 2 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ module "gcloud_wait_for_cluster" {
upgrade = var.gcloud_upgrade

create_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
create_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
create_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"
destroy_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
destroy_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
destroy_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"

module_depends_on = concat(
[google_container_cluster.primary.master_version],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ fi

PROJECT=$1
CLUSTER_NAME=$2
IMPERSONATE_SERVICE_ACCOUNT=$3
CLUSTER_LOCATION=$3
IMPERSONATE_SERVICE_ACCOUNT=$4

echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
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 [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
fi
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

Expand Down
4 changes: 2 additions & 2 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@ module "gcloud_wait_for_cluster" {
upgrade = var.gcloud_upgrade

create_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
create_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
create_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"
destroy_cmd_entrypoint = "${path.module}/scripts/wait-for-cluster.sh"
destroy_cmd_body = "${var.project_id} ${var.name} ${var.impersonate_service_account}"
destroy_cmd_body = "${var.project_id} ${var.name} ${local.location} ${var.impersonate_service_account}"

module_depends_on = concat(
[google_container_cluster.primary.master_version],
Expand Down
11 changes: 8 additions & 3 deletions modules/private-cluster/scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ fi

PROJECT=$1
CLUSTER_NAME=$2
IMPERSONATE_SERVICE_ACCOUNT=$3
CLUSTER_LOCATION=$3
IMPERSONATE_SERVICE_ACCOUNT=$4

echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
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 [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
fi
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

Expand Down
11 changes: 8 additions & 3 deletions scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ fi

PROJECT=$1
CLUSTER_NAME=$2
IMPERSONATE_SERVICE_ACCOUNT=$3
CLUSTER_LOCATION=$3
IMPERSONATE_SERVICE_ACCOUNT=$4

echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..."
echo "Waiting for cluster $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME to reconcile..."

while
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)" --impersonate-service-account="$IMPERSONATE_SERVICE_ACCOUNT")
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 [ -z "${current_status}" ]; then
echo "Unable to get status for $PROJECT/$CLUSTER_LOCATION/$CLUSTER_NAME"
exit 1
fi
[[ "${current_status}" != "RUNNING" ]]
do printf ".";sleep 5; done

Expand Down