mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
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:
commit
f8196d9048
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user