Skip to content

feat: allow removing the default namespace index of an informer - #3623

Merged
csviri merged 2 commits into
operator-framework:nextfrom
afalhambra-hivemq:feat/without-namespace-index-3615
Sep 18, 2026
Merged

csviri merged 2 commits into
operator-framework:nextfrom
afalhambra-hivemq:feat/without-namespace-index-3615

Conversation

@afalhambra-hivemq

Copy link
Copy Markdown
Contributor

Adds a withoutNamespaceIndex option, on the @Informer annotation and both config builders. When set, the pool calls removeNamespaceIndex() on the informer before starting it.

Couple of things I'd like your opinion on:

  • I made it part of InformerClassifier equality, unlike informerListLimit. The index can't be there for one event source and gone for another on a shared informer, so ones that disagree end up with separate informers, and the pool warns about it.
  • Left it opt in instead of just always dropping the index, since that would change cache behavior for everyone in a minor release. Happy to make it unconditional if you'd rather.

There are unit tests plus WithoutNamespaceIndexIT, and a short docs section. Had to update the informer pool identity list in the docs too.

Unrelated, but I noticed it on the way: InformerEventSourceConfiguration.Builder.updateFrom doesn't copy comparableResourceVersions, so setting it on a dependent gets parsed and then quietly reset to the default. Didn't touch it here, will open a separate issue.

Fixes #3615

Copilot AI lite review requested due to automatic review settings September 17, 2026 15:24
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 8eac3bdc-f668-4080-b137-04c36b02b27f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

🟡 Changes recommended

Two moderate compatibility findings and one documentation nit remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds opt-in withoutNamespaceIndex support for informers, removing the default namespace index while preserving pooling correctness.

Changes:

  • Adds annotation and builder configuration.
  • Propagates the option through informer management and pooling.
  • Adds identity handling, warnings, tests, and documentation.
File summaries
File Summary
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/withoutnamespaceindex/WithoutNamespaceIndexTestReconciler.java Configures the integration reconciler for the new option.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/withoutnamespaceindex/WithoutNamespaceIndexIT.java Adds end-to-end coverage.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/pool/NonSharingInformerPoolTest.java Tests non-sharing pool behavior.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/pool/InformerClassifierTest.java Tests classifier identity handling.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/pool/DefaultInformerPoolTest.java Tests duplicate-cache warning behavior.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/pool/AbstractInformerPoolTest.java Tests namespace-index removal.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerWrapperTest.java Tests informer wrapper behavior.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerManagerConcurrentReleaseTest.java Tests concurrent manager release behavior.
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/InformerConfigurationTest.java Tests configuration and builder support.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/pool/InformerClassifier.java Includes the option in informer identity. moderate (3 votes): retain the existing nine-argument constructor; nit (2 votes): correct the contradictory list-limit wording.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/pool/DefaultInformerPool.java Warns when differing settings create duplicate caches.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/pool/AbstractInformerPool.java Removes the namespace index before startup.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerManager.java Propagates the setting to classifiers.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Constants.java Defines the default value.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerEventSourceConfiguration.java Adds event-source builder support.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java Stores and exposes the option. moderate (3 votes): retain the previous protected constructor overload for compatibility.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/Informer.java Adds the annotation option.
docs/content/en/docs/documentation/eventing.md Documents configuration and informer pooling behavior.
Review details
  • Files reviewed: 18/18 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@afalhambra-hivemq
afalhambra-hivemq force-pushed the feat/without-namespace-index-3615 branch from 261b940 to c56608c Compare September 17, 2026 15:44

@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.

Can you please add the property also to ConfigLoader?

@csviri

csviri commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Left it opt in instead of just always dropping the index, since that would change cache behavior for everyone in a minor release. Happy to make it unconditional if you'd rather.

That makes sense IMO, we can change the default behavior in v6.

Signed-off-by: Antonio Fernandez Alhambra <antonio.alhambra@hivemq.com>
Signed-off-by: Antonio Fernandez Alhambra <antonio.alhambra@hivemq.com>
@afalhambra-hivemq
afalhambra-hivemq force-pushed the feat/without-namespace-index-3615 branch from c56608c to cf17145 Compare September 18, 2026 07:35
@afalhambra-hivemq

Copy link
Copy Markdown
Contributor Author

Can you please add the property also to ConfigLoader?

Done.
I noticed a couple of settings in this regard. For you to consider:

  • withDefaultFilters(boolean) has no binding today and that test passes anyway - a pre-existing gap in the same mechanism.
  • comparableResourceVersions exists on the builder but has no overrider method or config key, so the informer options are now asymmetric.

@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.

LGTM

@csviri
csviri merged commit 5100af7 into operator-framework:next Sep 18, 2026
29 checks passed
@csviri

csviri commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Thank you @afalhambra-hivemq !

withDefaultFilters(boolean) has no binding today and that test passes anyway - a pre-existing gap in the same mechanism.
comparableResourceVersions exists on the builder but has no overrider method or config key, so the informer options are now asymmetric.

good catch will create a PR for those!

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.

3 participants