Skip to content

Commit

Permalink
fix: cleanup should ignore patch failed (#1626)
Browse files Browse the repository at this point in the history
Subnet may already be deleted before patch, ignore it to fix flaky test.
  • Loading branch information
oilbeater authored Jun 20, 2022
1 parent 8c946a4 commit de99e82
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/images/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ while :; do
sleep 5
done

set +e
for subnet in $(kubectl get subnet -o name); do
kubectl patch "$subnet" --type='json' -p '[{"op": "replace", "path": "/metadata/finalizers", "value": []}]'
kubectl delete --ignore-not-found "$subnet"
done
set -e

for vlan in $(kubectl get vlan -o name); do
kubectl delete --ignore-not-found $vlan
Expand Down

0 comments on commit de99e82

Please sign in to comment.