Repository navigation
Conversation
Add withIndexer and withIndexers to InformerEventSourceConfiguration.Builder, expose them through getIndexers, and register them when the InformerEventSource is created. InformerEventSource.addIndexers is deprecated in favor of the builder; ControllerEventSource keeps using it. Closes operator-framework#3731 Signed-off-by: Exar-lab <exarviquezmasis@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change moving informer indexer configuration into the builder has no active review issues.
No open issues 🎉
What changed in this PR
Addresses #3731 by moving InformerEventSource indexer configuration into its builder, alongside other event-source settings.
Changes:
- Adds single and bulk indexer registration methods, exposing an unmodifiable map from built configurations.
- Registers configured indexers during event-source construction and deprecates direct
InformerEventSource.addIndexerscalls. - Adds unit coverage, migrates the read-own-updates reconciler, and documents builder usage.
| File | Description |
|---|---|
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/readownupdates/ReadOwnUpdatesReconciler.java |
Configures the resource-version index through the builder. |
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSourceTest.java |
Tests registration of configured indexers during construction. |
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/InformerEventSourceConfigurationTest.java |
Tests default, collected, and unmodifiable indexer maps. |
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java |
Registers configured indexers and deprecates direct registration. |
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerEventSourceConfiguration.java |
Adds builder methods and configuration access for indexers. |
docs/content/en/docs/documentation/working-with-es-caches.md |
Documents secondary-resource indexing through the builder. |
Review effort: Balanced
This branch has not been deployed
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.
Closes #3731
Indexers of an
InformerEventSourcecan now be configured on theInformerEventSourceConfigurationbuilder, like the rest of its properties.InformerEventSourceConfiguration.BuildergetswithIndexer(String, Function)andwithIndexers(Map).InformerEventSourceConfiguration#getIndexers()exposes them (default: empty, so existing implementations keep compiling). The built map is unmodifiable.InformerEventSourceregisters them when it is created, so they are in place before it starts.InformerEventSource#addIndexersis overridden and deprecated. As agreed in the issue,ManagedInformerEventSource,IndexerResourceCacheandControllerEventSourceare untouched, since the latter still needs it.ReadOwnUpdatesReconcileruses the builder, andworking-with-es-caches.mddocuments it.Tests: new unit tests for the builder and for an event source created with configured indexers.
InformerEventSourceConfigurationTest,InformerEventSourceTestandInformerWrapperTestpass, andspotless:checkandlicense:checkare clean. I did not run the integration tests, so theReadOwnUpdatesReconcilerchange is only checked by compilation.