Skip to content

Commit de7be2a

Browse files
committed
Remove potential stale ports before cleaning subnet
The proxy and az jobs create resources that may not be cleaned up upon job completion. One such example was seen in https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/periodic-ci-shiftstack-shiftstack-ci-main-periodic-4.13-e2e-openstack-az/1632828398344605696 where the leftover port on the proxy machine subnet caused the cleanup script to fail.
1 parent 439ada6 commit de7be2a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

clean-ci-resources.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ for resource in 'loadbalancer' 'server' 'router' 'subnet' 'network' 'volume snap
120120
echo "$r" | report $resource | xargs --verbose openstack $resource delete
121121
done
122122
;;
123+
subnet)
124+
for r in $(./stale.sh -q "$resource"); do
125+
network=$(openstack subnet show "$r" -c network_id -f value)
126+
ports=$(openstack port list --network "$network" -f value -c id)
127+
for port in $ports; do
128+
echo "$port" | report port | xargs --verbose openstack port delete
129+
done
130+
# shellcheck disable=SC2086
131+
echo "$r" | report $resource | xargs --verbose openstack $resource delete
132+
done
133+
;;
123134
*)
124135
# shellcheck disable=SC2086
125136
./stale.sh -q $resource | report $resource | xargs --verbose --no-run-if-empty openstack $resource delete

0 commit comments

Comments
 (0)