-
Notifications
You must be signed in to change notification settings - Fork 184
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
API changes proposal #760
API changes proposal #760
Conversation
...work-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/EventSource.java
Outdated
Show resolved
Hide resolved
...a/io/javaoperatorsdk/operator/processing/event/source/controller/UpdatableResourceCache.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/io/javaoperatorsdk/operator/processing/event/source/EventSourceRegistry.java
Outdated
Show resolved
Hide resolved
@@ -69,4 +67,9 @@ public void stop() throws OperatorException { | |||
super.stop(); | |||
cache.close(); | |||
} | |||
|
|||
@Override | |||
public T getAssociated(P primary) { |
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.
Why it needs the whole resource? I think this should be ideally as simple as possible API and just use the ResourceID
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 just generalizing the method that's already present on InformerEventSource
. This method will always be called in a context where the primary is available anyway so why restrict it to only providing the ResourceID
?
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.
not sure how we agreed on this, I still think it should be ResourceID :)
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
public class AbstractEventSourceTest<S extends EventSource, T extends EventHandler> { |
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.
This should be a Junit extension, as for Integration tests. I think there should be no inheritance in unit tests.
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.
Feel free to change that.
a30229a
to
2ac5c00
Compare
This makes the intent clearer: the `EventSourceInitializer` prepares `EventSource`s that the SDK then registers automatically, without the reconciler having to call the register method in `prepareEventSources`. This also allows for removing the `EventSourceRegistry` interface altogether.
c19529b
to
7dd8a64
Compare
...rk-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/EventSourceInitializer.java
Outdated
Show resolved
Hide resolved
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.
Let's merge this, will work on followup polishing
No description provided.