operator-framework / operator-framework/java-operator-sdk
Corner Case: Clenup Processing for Delete Event Without Finalizer
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 944
- Forks
- 242
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 43
Description
If Cleaner interface is implemented by a reconciler a finalizer is automatically added to the custom resource, and cleaner is called before it gets removed.
There is however a corner case when it makes sense to do cleanup event finalizer is not used. In case there is an in memory data held for a custom resource, so when a custom resource deleted, related indexed or in memory objects needs to be cleaned up. In this case a finalizer is not needed, since if the operator is down and the delete event is missed it's not a problem, since the cleanup is just for in memory data.
To support this we could add a feature flag to @ControllerConfiguration to don't add finalizer for cleanup: addFinalizerForCleaner.
Note that this is not a priority issue, we should probably implement it only if some requests it. Also having a finalizer in those cases would not be a big issues.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the @ControllerConfiguration annotation and trace how Cleaner implementations trigger finalizer handling during custom-resource deletion. Confirm where the delete event is processed and how cleanup is invoked. Done means the proposed configuration controls whether a cleaner adds a finalizer without changing cleanup behavior, with the relevant behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kubernetes
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100