Skip to content

Improved Event Source Management For Dependent Resources #2285

Closed
@csviri

Description

@csviri

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:

@Workflow(dependents = {
@Dependent(type = MultipleManagedDependentResourceConfigMap1.class,
useEventSourceWithName = CONFIG_MAP_EVENT_SOURCE),
@Dependent(type = MultipleManagedDependentResourceConfigMap2.class,
useEventSourceWithName = CONFIG_MAP_EVENT_SOURCE)
})

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions