feat: add withoutDefaultFilters option to skip JOSDK internal update …#3438
Open
xstefank wants to merge 1 commit into
Open
feat: add withoutDefaultFilters option to skip JOSDK internal update …#3438xstefank wants to merge 1 commit into
xstefank wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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
withoutDefaultFilterson@ControllerConfigurationand propagates it through resolved/runtime configuration. - Updates
ControllerEventSourceto skip internal UPDATE filters whenwithoutDefaultFiltersis enabled. - Exposes internal filter builders via
InternalEventFiltersand 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>
3cb5488 to
3be046b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3413