mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +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
|
||||
}
|
||||
|
||||
# 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 {
|
||||
if [[ ! -f "$AWS_SSH_KEY" ]]; then
|
||||
ssh-keygen -f "$AWS_SSH_KEY" -N ''
|
||||
@ -1415,8 +1433,7 @@ function kube-down {
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Deleting security group: ${sg_id}"
|
||||
$AWS_CMD delete-security-group --group-id ${sg_id} > $LOG
|
||||
delete_security_group ${sg_id}
|
||||
done
|
||||
|
||||
subnet_ids=$($AWS_CMD describe-subnets \
|
||||
|
Loading…
Reference in New Issue
Block a user