Also delete firewall rules and static IP addresses from stranded GCE LBs

This commit is contained in:
Alex Robinson 2015-10-06 18:27:11 -07:00
parent 9f80b87843
commit 55278545a4

View File

@ -24,7 +24,9 @@ result=0
for x in ${LIST}; do
if ! gcloud compute --project=${PROJECT} target-pools get-health "${x}" --region=${REGION} 2>/dev/null >/dev/null; then
echo DELETING "${x}"
gcloud compute --project=${PROJECT} firewall-rules delete "k8s-fw-${x}" -q
gcloud compute --project=${PROJECT} forwarding-rules delete "${x}" --region=${REGION} -q
gcloud compute --project=${PROJECT} addresses delete "${x}" --region=${REGION} -q
gcloud compute --project=${PROJECT} target-pools delete "${x}" --region=${REGION} -q
result=1
fi