-
Notifications
You must be signed in to change notification settings - Fork 236
Description
Based on comments and other remarks, but also from the usage experience, for v2 we plan to do changes in the public and Internal APIs, mainly some structural and naming changes on the main classes. Some of these changes are also result of the functional changes of v2 (like removing events from context). This issues is a summary of current planned renamings and the related open questions. (see also the linked PR)
We would be more then happy to receive some feedback, if the new model and naming is intuitive enough.
Public API Changes:
-
ResourceController->Reconciler- as mentioned on related issues the Controller is a higher level concept and it's defintelly higher level in controller-runtime for example (https://book.kubebuilder.io/architecture.html ), what in our case ResourceController was doing in v1 is implementing reconciliation logic (and defining event sources). So we renamed it toReconciler. -
Removed
init(EventSourceManager)method fromReconciler. The original intention was to allow to do some initializations and mainly register event sources by implementing this method. However, it is only used to register event sources and access theCustomResourceEventSource- this is required in some corner cases in our experience. So we removed theinitmethod and created a new interaceEventSourceInitializerwithprepareEventSources(EventSourceRegistry<T> eventSourceRegistry)to implement. So if Reconciler want's to register event sources needs to implement this method. Hopefully this better describes the domain. (We might further evaluate event source registration approach, since Reconciler might not be the best place to do that.) -
@Controller->@ControllerConfiguratio- the Controller annotation name made more sense on theResourceController. What it really does it provides configuration values for the controller (not really to theReconciler), ideally it would have the name@ControllerConfigurationbut we already have an interface elsewhere with that name. So it is still open how to rename this annotation if rename at all. -
EventSourceManagertoEventSourceRegistry- see below.
Internal Changes:
-
ConfiguredController->Controller- after also a bit of refactoring theConfiguredControlleris a high level aggregate that mostly directly (some indirectly) encapsulates all the classes regarding to one registered controller. Also now that theResourceControlleris renamed toReconcilertheConfiguredControllerwith it's original meaning does not make that much sense. Note that also after refactoring the controller is responsible of starting and stoping most of the major components from one place, what is now much cleaner. -
DefaultEventHandler->EventProcessor- We have an interface calledEventHandlerwhich is realted to EventSources, thus where the event source sends the events. TheDefaultEventHandleris processing the event, but we received more comments, why is there aDefaultEventHandleris this class clearly cannot be substituted with a different implementation. So renamedDefaultEventHandlerto make it more explicit that the intention to have aEventHandlerinterface is not to make it possibly replaceable with different implementation, but to segregate the interface what is facing the user (who implements anEventSource) -
EventSourceManagertoEventSourceRegistryANDDefaultEventSourceManager->EventSourceManager- similar as in previous, the purpose ofEventSourceManagerwas to have a separate interface facing the user who registers a event sources. So it makes sense made sense to rename it toEventSourceRegistry, and to make it more clear that the intention is not to give possibility to substituteDefaultEventSourceManagerwith other implementation, it was renamed toEventSourceManager -
EventDispatcher->ReconciliationDispatcher- the dispatching is not related at all anymore to events. Dispatching meant in this context, which method if theReconcileris called. This is based on the actual values in the custom resource.
This has also other responsibilities (like executing the the updates on custom resource, instructed by update control), so in case this name can be further refined.

