-
Hi, I would like to execute a custom finalizer if my operator deployment is deleted, so that I can remove entity finalizers from the existing CRs. So far I understand that i can manually add a finalizer in the deployment spec "metadata.finalizers: []" but is it possible to listen for such finalizer events ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey @prochnowc |
Beta Was this translation helpful? Give feedback.
-
Hi @buehler I managed to solve it. The exact problem was: Each CR managed by my operator gets a finalizer assigned. When deleting the deployment via helm, the operator and the CRs get deleted simultanously. Since the operator was deleted before it had a chance to execute the custom finalizer's the delete operation hung and did never complete. The solution: In my operator I've implemented a finalizer for it's own deployment. The finalizer blocks the deletion of the deployment until all finalizers of my CRs have run. |
Beta Was this translation helpful? Give feedback.
Hi @buehler
I managed to solve it.
The exact problem was:
Each CR managed by my operator gets a finalizer assigned. When deleting the deployment via helm, the operator and the CRs get deleted simultanously. Since the operator was deleted before it had a chance to execute the custom finalizer's the delete operation hung and did never complete.
The solution:
In my operator I've implemented a finalizer for it's own deployment. The finalizer blocks the deletion of the deployment until all finalizers of my CRs have run.