From 409280e189a3c7a16aaee3e3ce7045ebe4b170e2 Mon Sep 17 00:00:00 2001 From: JesusAlvarezTorres Date: Thu, 1 Oct 2020 11:03:51 -0700 Subject: [PATCH] test: E2E fix scale test indexing out of bounds (#3873) --- test/e2e/cluster.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/cluster.sh b/test/e2e/cluster.sh index 3c48afd991..c41ef8d4a5 100755 --- a/test/e2e/cluster.sh +++ b/test/e2e/cluster.sh @@ -328,8 +328,8 @@ if [ -n "$ADD_NODE_POOL_INPUT" ]; then fi if [ "${SCALE_CLUSTER}" = "true" ]; then - nodepools=$(jq -r '.properties.agentPoolProfiles[].name' < _output/$RESOURCE_GROUP/apimodel.json) - for ((i = 0; i <= ${#nodepools[@]}; ++i)); do + nodepoolcount=$(jq '.properties.agentPoolProfiles| length' < _output/$RESOURCE_GROUP/apimodel.json) + for ((i = 0; i < $nodepoolcount; ++i)); do nodepool=$(jq -r --arg i $i '. | .properties.agentPoolProfiles[$i | tonumber].name' < _output/$RESOURCE_GROUP/apimodel.json) if [ "${UPDATE_NODE_POOLS}" = "true" ]; then # modify the master VM SKU to simulate vertical vm scaling via upgrade