-
Couldn't load subscription status.
- Fork 232
refactor: renaming core classes and APIs #646
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
Conversation
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/ControllerUtils.java
Outdated
Show resolved
Hide resolved
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java
Outdated
Show resolved
Hide resolved
| * controller is delayed till the operator is started. | ||
| * | ||
| * @param controller the controller to register | ||
| * @param reconciler part of the controller to register |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that if we do this change, we need to remove the controller part completely everywhere and only talk about Reconciler because otherwiser it gets too confusing. Like what is a Controller is our SDK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answered above, the controller. Reconciler is just the logic how to reconciler, but this is basically same in controller runtime, the controller is the whole , reconciler is just part of it.
Unfortunate that we don't have a class representing the controller itslef, Maybe to renamae ConfiguredController to Controller?
...ator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java
Outdated
Show resolved
Hide resolved
...ator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java
Outdated
Show resolved
Hide resolved
| import io.javaoperatorsdk.operator.processing.event.EventSourceManager; | ||
|
|
||
| public class ConfiguredController<R extends CustomResource<?, ?>> implements ResourceController<R>, | ||
| public class ConfiguredController<R extends CustomResource<?, ?>> implements Reconciler<R>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this class should be renamed ConfiguredReconciler or maybe simply Controller, where for our SDK a Controller would be a Reconciler associated with its configuration? In this case, we should also rename the Controller annotation to something different, maybe Configuration… Then again, the more I think about it, maybe we shouldn't be renaming things too much if there is no obvious benefit from doing so… because otherwise it will mean that we confuse our existing users and we will need to update all our existing documentation / articles…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hehe, yes also wrote this above , maybe this should be the Controller, and the @Controller annotation should be @ControllerConfiguration.
I think this class should be our high level aggregate (therefore name it as Controller), so it will contiain the Reconciler, the EventSourceManager, the EventProcessor (former DefaultEventHandler). Basically every aspect of a single controller instance.
The benefit is that we are now closer to go terminology, but on the other hand yes it can be confusing for the users. But getting it right now for v2 is probably the good time to do it "once and for all" :)
- ConfiguredController now feels more like an overall aggregate. Now centrally starts and stop some aggregated components.
# Conflicts: # operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/event/EventSourceTestCustomReconciler.java
|
|
||
| default String getName() { | ||
| return ControllerUtils.getDefaultResourceReconcilerName(getAssociatedControllerClassName()); | ||
| return ControllerUtils.getDefaultReconcilerName(getAssociatedControllerClassName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getAssociatedControllerClassName should also be renamed to getAssociatedReconcilerClassName
DECISION_LOG.md
Outdated
| in case of event sources. Mostly it would be harder to manage the buffer, and the other event sources, thus what | ||
| does it mean for other event sources that there was a failed controller execution? Probably it would be better to | ||
| manage this in an abstract controller, and just use the "reprocess event-source" source in case of an error. | ||
| does it mean for other event sources that there was a failed controllerConfiguration execution? Probably it would be better to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you got too eager with search and replace :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intellij too intelligent :) will fix these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but probably we can delete Decision log since it is not used
README.md
Outdated
|
|
||
| Once you've added the dependency, define a main method initializing the Operator and registering a | ||
| controller. | ||
| controllerConfiguration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
docs/documentation/features.md
Outdated
|
|
||
| Controller execution is always triggered by an event. Events typically come from the custom resource | ||
| (i.e. custom resource is created, updated or deleted) that the controller is watching, but also from different sources | ||
| (i.e. custom resource is created, updated or deleted) that the controllerConfiguration is watching, but also from different sources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
docs/documentation/features.md
Outdated
|
|
||
| - an exception was thrown during execution, if yes schedules a retry. | ||
| - there are new events received during the controller execution, if yes schedule the execution again. | ||
| - there are new events received during the controllerConfiguration execution, if yes schedule the execution again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many instances of controller got renamed to controllerConfiguration when they shouldn't have.
ahh ok thx, will check it. |
|
@metacosm @lburgazzoli @adam-sandor can I merge this? |
…tionAnnotationProcessor
Considering this as the next step for refactoring the core classes. Not necessary final in this regard, we might want to do more iterations on this.