Skip to content
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

Resource cleanup (kind/minikube) on failure #68

Closed
davidfrickert opened this issue Nov 23, 2024 · 3 comments
Closed

Resource cleanup (kind/minikube) on failure #68

davidfrickert opened this issue Nov 23, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@davidfrickert
Copy link
Contributor

davidfrickert commented Nov 23, 2024

Would it be possible to attempt a graceful cleanup of the kind / minikube cluster when a failure or termination occurs?

At the moment, if the app panics, or is terminated (e.g. by terminating a CI pipeline) somewhere after creating the cluster, it will not be removed and will stay there for eternity which is not ideal.

I'm not familiar with rust so unsure how that would be implemented, but some hook that could trigger the cluster deletion if a panic or SIGTERM is detected would be nice. In the Java world this would be a Shutdown Hook, I hope there is something similar in rust.

Perhaps https://doc.rust-lang.org/std/panic/fn.catch_unwind.html could work? Or maybe refactor the code such that panic's don't occur and errors are handled gracefully!

@dag-andersen dag-andersen added the enhancement New feature or request label Nov 24, 2024
@dag-andersen
Copy link
Owner

Hi @davidfrickert

Great point!

I hadn’t really thought of it as an issue since GitHub-hosted runners automatically clean everything up when the workflow finishes. Keeping the cluster running when the program panics is helpful during development, as it makes debugging the cluster easier — but I can make that optional so that, by default, it always cleans up the cluster.

I’ll add it to my to-do list and aim to implement it next week. I’m quite busy this week, so it’ll have to wait.

@dag-andersen
Copy link
Owner

Hi @davidfrickert

Version 0.0.25 was just released 🚀 This version should cleanup the cluster on failure. Let me know if you experience any issues :)

@davidfrickert
Copy link
Contributor Author

great @dag-andersen, thanks for taking it into consideration 😄

i'll upgrade and let you know if it doesn't work as intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants