From 586b6fc3d7171af539890ce5c3e08e15deb99bac Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Thu, 28 Mar 2019 00:38:49 +0000 Subject: [PATCH] review comments --- net/gce.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/gce.sh b/net/gce.sh index 4e73dd7200..cbfb4a9df7 100755 --- a/net/gce.sh +++ b/net/gce.sh @@ -481,10 +481,9 @@ EOF num_zones=${#zones[@]} numNodesPerZone=$((additionalFullNodeCount / num_zones)) numLeftOverNodes=$((additionalFullNodeCount % num_zones)) - count=0 - for zone in "${zones[@]}"; do - count=$((count + 1)) - if [[ $count -eq $num_zones ]]; then + for ((i=0; i < $num_zones; i++)); do + zone=${zones[i]} + if [[ $i -eq $((num_zones - 1)) ]]; then numNodesPerZone=$((numNodesPerZone + numLeftOverNodes)) fi cloud_CreateInstances "$prefix" "$prefix-$zone-fullnode" "$numNodesPerZone" \