Merge pull request #24834 from ixdy/node-names

Automatic merge from submit-queue

Fix detect-node-names to not error out if there are no nodes

Fixes #21564.

Teardown was not working correctly in rare cases because `detect-node-names` was failing before any of the actual cleanup was run. I'm pretty sure the issue was that there was an instance group, but no instances in the instance group, so we bailed out when we tried to expand the bash array.

This PR adds a guard so we don't bail if the array is empty.

cc @jlowdermilk @spxtr
This commit is contained in:
k8s-merge-robot 2016-04-29 16:37:41 -07:00
commit f8196d9048
2 changed files with 3 additions and 6 deletions

View File

@ -295,12 +295,9 @@ function detect-node-names {
"${group}" --zone "${ZONE}" --project "${PROJECT}" \
--format='value(instance)'))
done
echo "INSTANCE_GROUPS=${INSTANCE_GROUPS[*]}" >&2
echo "NODE_NAMES=${NODE_NAMES[*]}" >&2
else
echo "INSTANCE_GROUPS=" >&2
echo "NODE_NAMES=" >&2
fi
echo "INSTANCE_GROUPS=${INSTANCE_GROUPS[*]:-}" >&2
echo "NODE_NAMES=${NODE_NAMES[*]:-}" >&2
}
# Detect the information about the minions

View File

@ -251,7 +251,7 @@ function detect-node-names {
"${NODE_INSTANCE_GROUP}" --zone "${ZONE}" --project "${PROJECT}" \
--format='value(instance)'))
echo "NODE_NAMES=${NODE_NAMES[*]}"
echo "NODE_NAMES=${NODE_NAMES[*]:-}"
}
# Detect instance group name generated by gke.