Skip to content

feat: add onUpdateFilterCombinedWithOr option to ControllerConfiguration#3437

Closed
xstefank wants to merge 1 commit into
operator-framework:mainfrom
xstefank:informer-filters-or
Closed

feat: add onUpdateFilterCombinedWithOr option to ControllerConfiguration#3437
xstefank wants to merge 1 commit into
operator-framework:mainfrom
xstefank:informer-filters-or

Conversation

@xstefank

Copy link
Copy Markdown
Collaborator

Fixes #3413

Signed-off-by: xstefank <xstefank122@gmail.com>
Copilot AI review requested due to automatic review settings June 23, 2026 07:06
@openshift-ci openshift-ci Bot requested review from csviri and metacosm June 23, 2026 07:06

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 option to combine user-provided OnUpdateFilter logic with JOSDK’s internal update filters using OR (instead of the current AND), enabling reconciliation on selected status-only updates while keeping generation-aware filtering enabled (addresses #3413).

Changes:

  • Introduces onUpdateFilterCombinedWithOr on @ControllerConfiguration and propagates it through resolved/overridden controller configuration.
  • Updates ControllerEventSource to combine user/internal update filters with OR when configured.
  • Adds unit + integration tests covering the new OR-combination behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/controller/ControllerEventSource.java Applies OR vs AND composition for user/internal update filters based on new config flag.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java Adds the onUpdateFilterCombinedWithOr annotation attribute and documents behavior.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ResolvedControllerConfiguration.java Stores and exposes the resolved OR-combination flag.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverrider.java Allows overriding the OR-combination flag programmatically.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java Adds default accessor isOnUpdateFilterCombinedWithOr() to config interface.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/BaseConfigurationService.java Reads the new annotation attribute and wires it into resolved configuration.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/controller/ControllerEventSourceTest.java Adds unit tests validating OR behavior at the event source level.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/filter/OrCombinedUpdateFilter.java Test filter used to validate OR-combination behavior in an IT scenario.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/filter/OrCombinedFilterTestReconciler.java Test reconciler configured with onUpdateFilterCombinedWithOr = true.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/filter/OrCombinedFilterIT.java Integration test demonstrating reconcile triggers on status/metadata-only updates via OR.

Comment on lines +65 to +71
filter -> {
if (config.isOnUpdateFilterCombinedWithOr()) {
setOnUpdateFilter(filter.or(internalOnUpdateFilter));
} else {
setOnUpdateFilter(filter.and(internalOnUpdateFilter));
}
},

@csviri csviri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@xstefank please target next branch with the features.

As I mentioned on the other PR I would prefer rather a flag for not adding filters, and user can customize fully.

Note that this way is not very future proof either, since we just talking here about in Update filters in the PR, where current filters happens to be update that we set by default, but this might change in any release, so then we would need to change/add a new config param. What we should try to avoid.

@xstefank xstefank closed this Jun 23, 2026
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.

Support SSA in InformerEventSource, listen to specific status updates

3 participants