From f48268d13bd8b3cb6298a037e09b490a436c00e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Przychodze=C5=84?= Date: Thu, 19 Mar 2020 13:31:07 +0100 Subject: [PATCH] Util script - move variables setting for replicated master to outer if --- cluster/gce/util.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 082f6265dc2..18bac60a49e 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -3578,11 +3578,11 @@ function kube-down() { # In the replicated scenario, if there's only a single master left, we should also delete load balancer in front of it. if [[ "${REMAINING_MASTER_COUNT}" -eq 1 ]]; then + detect-master + local REMAINING_REPLICA_NAME="$(get-all-replica-names)" + local REMAINING_REPLICA_ZONE=$(gcloud compute instances list "${REMAINING_REPLICA_NAME}" \ + --project "${PROJECT}" --format="value(zone)") if gcloud compute forwarding-rules describe "${MASTER_NAME}" --region "${REGION}" --project "${PROJECT}" &>/dev/null; then - detect-master - local REMAINING_REPLICA_NAME="$(get-all-replica-names)" - local REMAINING_REPLICA_ZONE=$(gcloud compute instances list "${REMAINING_REPLICA_NAME}" \ - --project "${PROJECT}" --format="value(zone)") gcloud compute forwarding-rules delete \ --project "${PROJECT}" \ --region "${REGION}" \