feat: allow removing the default namespace index of an informer - #3623
afalhambra-hivemq wants to merge 1 commit into
Conversation
|
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 ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
🟡 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.
| Long informerListLimit, | ||
| FieldSelector fieldSelector, | ||
| Boolean comparableResourceVersions, | ||
| Boolean withoutNamespaceIndex, |
There was a problem hiding this comment.
I'd rather not add compatibility overloads here. A constructor that quietly defaults the new field is how config silently goes missing. Leaving it open for @csviri to decide
| Long informerListLimit, | ||
| ItemStore<R> itemStore) { | ||
| ItemStore<R> itemStore, | ||
| boolean withoutNamespaceIndex) { |
There was a problem hiding this comment.
Same as previous one. And I think it would be worse in this case, since the classifier is the informer sharing key, so a caller could build one that silently disagrees about the index.
Signed-off-by: Antonio Fernandez Alhambra <antonio.alhambra@hivemq.com>
261b940 to
c56608c
Compare
Adds a
withoutNamespaceIndexoption, on the@Informerannotation and both config builders. When set, the pool callsremoveNamespaceIndex()on the informer before starting it.Couple of things I'd like your opinion on:
InformerClassifierequality, unlikeinformerListLimit. 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.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.updateFromdoesn't copycomparableResourceVersions, 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