Merge pull request #89257 from jprzychodzen/fix-create

Util script - move variables setting for replicated master to outer if
This commit is contained in:
Kubernetes Prow Robot 2020-03-26 14:10:36 -07:00 committed by GitHub
commit 08ce946e09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3579,11 +3579,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}" \