mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
Fix: Refactor firewall-rules list to read-array
This commit is contained in:
parent
1913c6be35
commit
f35799f6b1
@ -2576,11 +2576,13 @@ function create-cloud-nat-router() {
|
||||
}
|
||||
|
||||
function delete-all-firewall-rules() {
|
||||
if fws=$(gcloud compute firewall-rules list --project "${NETWORK_PROJECT}" --filter="network=${NETWORK}" --format="value(name)"); then
|
||||
echo "Deleting firewall rules remaining in network ${NETWORK}: ${fws}"
|
||||
delete-firewall-rules "$fws"
|
||||
local -a fws
|
||||
kube::util::read-array fws < <(gcloud compute firewall-rules list --project "${NETWORK_PROJECT}" --filter="network=${NETWORK}" --format="value(name)")
|
||||
if (( "${#fws[@]}" > 0 )); then
|
||||
echo "Deleting firewall rules remaining in network ${NETWORK}: ${fws[*]}"
|
||||
delete-firewall-rules "${fws[@]}"
|
||||
else
|
||||
echo "Failed to list firewall rules from the network ${NETWORK}"
|
||||
echo "No firewall rules in network ${NETWORK}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user