Skip to content

[Question] NoOp Event Source for Secondary Resource #2904

@michaelkoepf

Description

@michaelkoepf

Hi,

Assume I have a primary resource that reconciles a dependent resource via a standalone workflow. The workflow depends on information in the primary resource, thus, will be created on first reconciliation of the primary resource.

For the secondary resource, I do not want to be informed of changes of the dependent resource. However, when I do not override public List<EventSource<?, T>> prepareEventSources(final EventSourceContext<T> context) in the class implementing Reconciler<T> for the primary resource, or simply return an empty list, I get a NoEventSourceForClassException when I retrieve the secondary resource via context.getSecondaryResource().

Can I just use a GenericFilter to avoid change notifications of the secondary? E.g.,

InformerEventSourceConfiguration<MySecondary> configMapConfiguration =
        InformerEventSourceConfiguration.from(MySecondary.class, MyPrimary.class).withGenericFilter(resource -> false).build();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions