Description
User Story
As a developer/operator, I would like to run some custom logic/code for certain lifecycle events in the CAPI objects and pause the object reconciliation until the external entity finishes its execution.
Detailed Description
Currently, in CAPI, we have the ability to alter the Machine object's lifecycle after it has been marked for deletion using a special set of annotations. The presence of these annotations pauses the reconciliation,(in this case deletion) of the Machine object until the action taken by the external component is completed which is indicated by the removal of the annotations.
Extending on this pattern, as a cluster operator, I would like to have the ability to subscribe to the lifecycle events (creation/deletion/scaling up) for CAPI objects, run some custom logic and pause the object reconciliation until the execution is finished.
Anything else you would like to add:
The idea is to come up with a generic way of attaching external subscribers to events in the CAPI object lifecycle, which can be backed by Conditions (initial thought, might not be the only way to achieve this). The reconciliation of the CAPI object is paused until all the subscribers subscribing to that event finish executing their custom logic. To ensure that failures during the execution of these custom actions do not block the normal operation of the CAPI objects, add a prescribable timeout with defaults while registering the subscribers.
/kind feature