Skip to content

Commit

Permalink
Fix deleting CRDs at the end of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick committed Jun 13, 2024
1 parent 4572661 commit 548288d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ done
if [ "$CLEANUP_NAMESPACE" == "true" ]; then
helm -n "$NAMESPACE" uninstall prometheus-operator --ignore-not-found
kubectl delete namespace "$NAMESPACE"
kubectl delete crd $(kubectl api-resources --api-group=monitoring.coreos.com --output name)
mapfile -t crds < <(kubectl api-resources --api-group=monitoring.coreos.com --output name)
if [ ${#crds[@]} -ne 0 ]; then
kubectl delete crd "${crds[@]}"
fi
fi

exit $result

0 comments on commit 548288d

Please sign in to comment.