You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And actually, the user should directly register the EventSource that the user wants to register with the EventSourceManager inside the init method.
like this
@Override
public void init(EventSourceManager eventSourceManager) {
...
eventSourceManager.registerEventSource(eventSource);
}
Personally, I think this might be a bit ambiguous.
It feels like the user can directly inject and use CustomEventSourceManager .
If that's not what you intended, Rather, I think the interface below would be a little clearer.
HI, all
I was wondering how to register eventSource in Controller, so I looked at the code.
https://github.com/java-operator-sdk/java-operator-sdk/blob/2e8f219437e53b9ca58f146a24397dbf38f0bfb8/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/ResourceController.java#L55
Looking at this method, it looks like I can create and use my own
EventSourceManager
.However, in reality, when
operator.start()
starts,DefaultEventSourceManager
is unconditionally injected inconfiguredController.
(https://github.com/java-operator-sdk/java-operator-sdk/blob/2e8f219437e53b9ca58f146a24397dbf38f0bfb8/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/ConfiguredController.java#L178-L179)
And actually, the user should directly register the
EventSource
that the user wants to register with the EventSourceManager inside the init method.like this
Personally, I think this might be a bit ambiguous.
It feels like the user can directly inject and use CustomEventSourceManager .
If that's not what you intended, Rather, I think the interface below would be a little clearer.
And by calling this method in the framework, it will be able to directly register it with the event source manager.
Since
EventSourceManager
is an important component in the framework, it seems to be able to prevent it from being directly exposed to users.This is just my personal opinion.
Thank you for reading this question :)
operator-framework#615
The text was updated successfully, but these errors were encountered: