mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #22783 from justinsb/fix_21147
Auto commit by PR queue bot
This commit is contained in:
commit
353c382761
@ -824,6 +824,24 @@ function release-elastic-ip {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Deletes a security group
|
||||||
|
# usage: delete_security_group <sgid>
|
||||||
|
function delete_security_group {
|
||||||
|
local -r sg_id=${1}
|
||||||
|
|
||||||
|
echo "Deleting security group: ${sg_id}"
|
||||||
|
|
||||||
|
# We retry in case there's a dependent resource - typically an ELB
|
||||||
|
n=0
|
||||||
|
until [ $n -ge 20 ]; do
|
||||||
|
$AWS_CMD delete-security-group --group-id ${sg_id} > $LOG && return
|
||||||
|
n=$[$n+1]
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
echo "Unable to delete security group: ${sg_id}"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
function ssh-key-setup {
|
function ssh-key-setup {
|
||||||
if [[ ! -f "$AWS_SSH_KEY" ]]; then
|
if [[ ! -f "$AWS_SSH_KEY" ]]; then
|
||||||
ssh-keygen -f "$AWS_SSH_KEY" -N ''
|
ssh-keygen -f "$AWS_SSH_KEY" -N ''
|
||||||
@ -1415,8 +1433,7 @@ function kube-down {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Deleting security group: ${sg_id}"
|
delete_security_group ${sg_id}
|
||||||
$AWS_CMD delete-security-group --group-id ${sg_id} > $LOG
|
|
||||||
done
|
done
|
||||||
|
|
||||||
subnet_ids=$($AWS_CMD describe-subnets \
|
subnet_ids=$($AWS_CMD describe-subnets \
|
||||||
|
Loading…
Reference in New Issue
Block a user