kudobuilder/kuttl

Option for custom cleanup before namespace deletion

Opened this issue · 0 comments

What would you like to be added:
It would be nice to add an option to run a custom cleanup script before the namespace and everything is dropped.

Why is this needed:
In our case we run operator and database cluster custom resource which has finalizer and when kuttl finishes with the test it just tries to delete everything, but since the operator can be deleted first the database cr and the namespace will be left since it contains finalizer.
So it would be helpful to be able to execute custom cleanup which will remove the finalizers and we could then leave the kuttl to finish with deleting everything.
Currently we add a last step in each test where we drop the finalizer, but this only works if the test passes and this step is actually run (if the test fails the namespace and cr will be left until manually cleaned up).

We are open to making a contribution, but we need to know that it would make sense first, also maybe there's some better idea how to resolve this.

Thanks!