Document explicitly that timer/daemon override request for no finalizer.
GrahamDumpleton opened this issue · comments
Problem
Using:
@kopf.on.delete("example.com", "v1alpha1", "example", optional=True)
def example_delete(**_):
pass
with expectation that a finalizer will not be added for kopf operator to resource.
At the same time using @kopf.timer
on same resource type.
Use of @kopf.timer
overrides optional=True
in @kopf.on.delete
and makes finalizer mandatory.
See
Line 764 in 91e8fd6
Not even speculating on why that is required for a timer, but I can't seem to find a warning on docs for timer that using it will cause optional=True
in @kopf.on.delete
to be ignored.
Proposal
Add warning in docs if analysis is correct and this is a requirement for using @kopf.timer
. IOW, warn that optional
argument to @kopf.on.delete
will be overridden.
Code
No response
Additional information
The @kopf.daemon
also overrides requirement for finalizer. The docs for it have section https://kopf.readthedocs.io/en/stable/daemons/#deletion-prevention and finalizers are mentioned, although still isn't explicit in saying that optional=True
will be ignored in @kopf.on.delete
as a result.
Section https://kopf.readthedocs.io/en/stable/handlers/#state-changing-handlers in docs where mentions optional=True
should also perhaps note that this will be ignored in case of @kopf.timer
and @kopf.daemon
being used.