Skip to content

Fix: setup.sh to delete resources properly #4718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/e2e/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ function create_cluster {
# delete_cluster
function delete_cluster {
: ${KIND_CLUSTER:?"KIND_CLUSTER must be set"}
echo "Deleting cert-manager resources..."
kubectl delete --ignore-not-found=true -n kube-system deployment cert-manager-cainjector
kubectl delete --ignore-not-found=true -n kube-system deployment cert-manager-controller
kubectl delete --ignore-not-found=true -n kube-system deployment cert-manager-webhook

# Delete the cert-manager namespace itself (if it exists)
kubectl delete --ignore-not-found=true namespace cert-manager

# Delete Calico
echo "Deleting Calico..."
kubectl delete --ignore-not-found=true -f https://docs.projectcalico.org/manifests/calico.yaml

# Finally, delete the Kind cluster
echo "Deleting Kind cluster..."
kind delete cluster --name $KIND_CLUSTER
}

Expand Down