Skip to content

feat: add withoutDefaultFilters option to skip JOSDK internal update …#3438

Open
xstefank wants to merge 1 commit into
operator-framework:nextfrom
xstefank:without-default-filters-next
Open

feat: add withoutDefaultFilters option to skip JOSDK internal update …#3438
xstefank wants to merge 1 commit into
operator-framework:nextfrom
xstefank:without-default-filters-next

Conversation

@xstefank

Copy link
Copy Markdown
Collaborator

Fixes #3413

Copilot AI review requested due to automatic review settings June 23, 2026 08:11
@openshift-ci openshift-ci Bot requested review from csviri and metacosm June 23, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new controller configuration switch to let users fully control UPDATE-event filtering (instead of having JOSDK’s internal update filters always AND-ed in), addressing the “logical OR” filtering use case described in issue #3413 (e.g., generation-aware updates OR a specific status/metadata change).

Changes:

  • Introduces withoutDefaultFilters on @ControllerConfiguration and propagates it through resolved/runtime configuration.
  • Updates ControllerEventSource to skip internal UPDATE filters when withoutDefaultFilters is enabled.
  • Exposes internal filter builders via InternalEventFilters and adds unit/integration tests demonstrating behavior.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/filter/WithoutDefaultFiltersUpdateFilter.java Adds a composed user update filter (example) using InternalEventFilters + custom logic.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/filter/WithoutDefaultFiltersReconciler.java Adds a test reconciler configured with withoutDefaultFilters = true.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/filter/WithoutDefaultFiltersIT.java Adds an IT validating user-controlled UPDATE filtering when defaults are skipped.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/controller/ControllerEventSourceTest.java Adds unit tests ensuring user filter is applied directly when defaults are skipped.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/controller/InternalEventFilters.java Makes internal filter helpers public so users can explicitly compose default behavior.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/controller/ControllerEventSource.java Implements the new withoutDefaultFilters behavior in the controller event source.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java Adds the withoutDefaultFilters annotation attribute + documentation.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ResolvedControllerConfiguration.java Persists the withoutDefaultFilters flag in resolved configuration.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverrider.java Adds an override hook to set withoutDefaultFilters.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java Adds isWithoutDefaultFilters() to the runtime configuration interface.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/BaseConfigurationService.java Reads withoutDefaultFilters from the annotation and wires it into resolved config.

Comment on lines +60 to +62
if (config.isWithoutDefaultFilters()) {
Optional.ofNullable(informerConfig.getOnUpdateFilter()).ifPresent(this::setOnUpdateFilter);
} else {
Comment on lines +58 to +60
res.getMetadata()
.setAnnotations(Map.of(WithoutDefaultFiltersReconciler.TRIGGER_ANNOTATION, "true"));
operator.replace(res);
…filters

Signed-off-by: xstefank <xstefank122@gmail.com>
@xstefank xstefank force-pushed the without-default-filters-next branch from 3cb5488 to 3be046b Compare June 23, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants