mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
AWS: kube-down was failing with no instances
The new delete-ASG logic wasn't correct if there were no instances
This commit is contained in:
parent
4566e039bf
commit
84bab0dae5
@ -1204,6 +1204,7 @@ function kube-down {
|
||||
Name=tag:KubernetesCluster,Values=${CLUSTER_ID} \
|
||||
--query Reservations[].Instances[].InstanceId)
|
||||
|
||||
if [[ -n "${instance_ids}" ]]; then
|
||||
asg_groups=$($AWS_CMD --output text describe-instances \
|
||||
--query 'Reservations[].Instances[].Tags[?Key==`aws:autoscaling:groupName`].Value[]' \
|
||||
--instance-ids ${instance_ids})
|
||||
@ -1218,7 +1219,6 @@ function kube-down {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -n "${instance_ids}" ]]; then
|
||||
$AWS_CMD terminate-instances --instance-ids ${instance_ids} > $LOG
|
||||
echo "Waiting for instances to be deleted"
|
||||
while true; do
|
||||
|
Loading…
Reference in New Issue
Block a user