-
Notifications
You must be signed in to change notification settings - Fork 26
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
Remove leftover e2e resouces due to test failure #1034
base: main
Are you sure you want to change the base?
Conversation
Also there is Prometheus resources maybe leftover, wondering if we should add another make target or use the same one "cleanup-e2e-env": |
We can make it a target for makefile. Here are the commands I used on the top of the ones you posted. Some are duplicates. |
|
||
# Fetch leftover kuttl resources and remove the namespace | ||
for ns in $(kubectl get ns | grep kuttl-test | cut -d' ' -f1); do | ||
kubectl delete all --all -n $ns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't clean up prometheus-kube-prometheus-kube-proxy which is in kube-system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, here I intend to remove only kuttl-test namespace leftover resources. For the other kinds I may add another target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a separate PR, just do it here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I didn't mean another PR, I mean another make target. Deleting non-namespace scoped resources can be very destructive, for example: kubectl delete clusterrole. It will impact the Prometheus instance.
@roypaulin @cchen-vertica @qindotguan @LiboYu2
In my local env, when kuttl test failed, there are leftover resources left in my cluster.
Create a make target "cleanup-e2e-env" to remove those resources and namespace.
Create a make target "cleanup-prometheus-leftover" to remove leftover resources for Prometheus.