Description
In some use cases it would handy to implement custom code before the managed workflows executes, see for example:
#1896
Currently the managed workflow always execute before the reconcile(...)
method automatically. What we could provide is a method invoke the managed workflow:
public UpdateControl<MyCustomResource> reconcile(MyCustomResource primary, Context<MyCustomResource> context) {
simulateErrorIfRequested(webPage);
// custom code before workflow execution
context.managedDependentResourceContext().invokeWorkflow();
// custom code after workflow execution
return UpdateControl.patchStatus(primary);
}
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:
@ControllerConfiguration(
workflow = @Workflow(
explicitInvocation = true,
dependents = {
@Dependent(...),
@Dependent(...)}
)
public class MyCustomResourceReconciler { }
see also related issue about naming: #1773