Speedup cleanup
* Speedup cleanup
Run kubectl in parallel and wait for all of them to return.
* Add --wait for resources to be truly gone
@@ -6,9 +6,11 @@ set -aueo pipefail
source .env
for ns in "$BOOKWAREHOUSE_NAMESPACE" "$BOOKBUYER_NAMESPACE" "$BOOKSTORE_NAMESPACE" "$BOOKTHIEF_NAMESPACE" "$K8S_NAMESPACE"; do
- kubectl delete namespace "$ns" --ignore-not-found
+ kubectl delete namespace "$ns" --ignore-not-found --wait &
done
# Clean up Hashicorp Vault deployment
-kubectl delete deployment vault -n "$K8S_NAMESPACE" --ignore-not-found
-kubectl delete service vault -n "$K8S_NAMESPACE" --ignore-not-found
+kubectl delete deployment vault -n "$K8S_NAMESPACE" --ignore-not-found --wait &
+kubectl delete service vault -n "$K8S_NAMESPACE" --ignore-not-found --wait &
+
+wait
