Closed csviri closed 7 months ago
Would it make sense to have pre- and post-reconcile workflows that would get executed before and after calling the main reconciler method, respectively?
Not sure how the user would then update the status, based on the results of the flow after the second workflow. Was thinking on other variants also, like having a list of managed workflows.
But would not complicate it, there are still standalone workflows for complex use cases. And usually I guess users have a set of resources they want to reconcile, with custom invocation we give possibility to check the precondition / pre-processing and set the status after, this is both general and powerful enough.
Typically this would be useful also to set some default values as discussed here: https://discordapp.com/channels/723455000604573736/723455000604573739/1201920896080543824
Note that this is little bit more cumbersome for cleanup, if Cleaner
interface is not implemented probably should be called implicitly even the flag is there (when not all dependents are garbage collected), if cleaner is implemented it should be called explicitly when the flag is on.
What about making the @Workflow
annotation a top level and directly appleid to the Reconciler?
IMHO this would improve readability as personally I'm not a fun of overusing nested annotations.
I wonder if this is not misleading.
context.managedDependentResourceContext().invokeWorkflow();
Maybe should be:
context.managedWorkflowContext().invokeWorkflow()
In some use cases it would handy to implement custom code before the managed workflows executes, see for example: https://github.com/java-operator-sdk/java-operator-sdk/issues/1896
Currently the managed workflow always execute before the
reconcile(...)
method automatically. What we could provide is a method invoke the managed workflow:Probably would be nicer to do this just in some cases, so NOT require explicit invocation by default.
So such a feature flag could look like:
see also related issue about naming: https://github.com/java-operator-sdk/java-operator-sdk/issues/1773