-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Summary of Proposed Changes for Naming and Related Refactoring for V2 #655
Comments
I really like those changes! Reconciler FTW :) |
+1 with me |
|
I think The V2 model appears to be a more intuitive and understandable architectural model. 👍 |
Renaming and refactoring structures based on the rational described in #655
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 theinit
method and created a new interaceEventSourceInitializer
withprepareEventSources(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@ControllerConfiguration
but we already have an interface elsewhere with that name. So it is still open how to rename this annotation if rename at all.EventSourceManager
toEventSourceRegistry
- see below.Internal Changes:
ConfiguredController
->Controller
- after also a bit of refactoring theConfiguredController
is a high level aggregate that mostly directly (some indirectly) encapsulates all the classes regarding to one registered controller. Also now that theResourceController
is renamed toReconciler
theConfiguredController
with 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 calledEventHandler
which is realted to EventSources, thus where the event source sends the events. TheDefaultEventHandler
is processing the event, but we received more comments, why is there aDefaultEventHandler
is this class clearly cannot be substituted with a different implementation. So renamedDefaultEventHandler
to make it more explicit that the intention to have aEventHandler
interface is not to make it possibly replaceable with different implementation, but to segregate the interface what is facing the user (who implements anEventSource
)EventSourceManager
toEventSourceRegistry
ANDDefaultEventSourceManager
->EventSourceManager
- similar as in previous, the purpose ofEventSourceManager
was 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 substituteDefaultEventSourceManager
with 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 theReconciler
is 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.
v1 Model:
![v1_model](https://user-images.githubusercontent.com/5443269/140489304-8974b034-bf16-4b12-b657-c63dc007addb.jpg)
v2 Model:
![v2_model](https://user-images.githubusercontent.com/5443269/140489380-26663fd1-aa15-4563-9f66-bdfdf1d5624e.jpg)
see also:
#615
#374
The text was updated successfully, but these errors were encountered: