-
Notifications
You must be signed in to change notification settings - Fork 218
Improved Event Source Management For Dependent Resources #2285
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
Comments
Will try to summarize it here, what are the related questions/dilemmas to these 3 issues.
Here comes the picture of the configuration, we could say that two event sources are equal if their configuration is equal and they have the same type of course. But what happens if a DR provides an ES with a different name but the same config as already registered? Should they just provide event sources, and we can check if there is already an event source with the same config? Or just a NamedEventSource, and double check if there is no event source with the same type and configuration. I lean towards the latest:
Not sure if we should have explicit config notion on the level of EventSource interface, maybe a specialized We should probably add an ADR regarding this. |
After experimenting with the equality of Event Sources, we found that there are some caveats with implementations. When checking equality for InformerEventSource for example, we check the equality of all the config values, however, this is problematic for interfaces like So for now decided to stick with explicit event source setting. |
If there are multiple dependents for the same type they usually share event sources. Well in general we require that if event there are two Event Sources registered for the same type they manage a distinct set of resources.
See sample:
java-operator-sdk/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/multiplemanageddependentsametype/MultipleManagedDependentResourceReconciler.java
Lines 16 to 21 in 31fec7c
If they anyway share most of the cases with the Event Sources, we could handle this similarly as for the dynamically registered resources, if we make the resource named as described in this issue the Dependent Resource could name the event source by default based on it's type. (Like it will return
ConfigMap
as the name for InformerEventSource for a ConfigMap), thus if multiple Dependent Resources return the same event source with the same name it will just register one those.The only problem is that those event sources theoretically can have different configuration. Currently this can be event configured with an annotation, see
@KubernetesDependent
, but if we could say that every Event Source has a configuration, that could be compared (and error thrown if those are not the same).See also: #1937 (note that this issue is more radical than just comparing the configurations)
The text was updated successfully, but these errors were encountered: