feat: shard selector support#3429
Merged
Merged
Conversation
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds “shard selector” support to the informer configuration pipeline so operators can restrict watched resources to a shard (in addition to the existing label selector), exposing it via config keys, annotation, builder APIs, and wiring it into the Fabric8 informer client calls.
Changes:
- Add new controller config bindings for
shard-selector/informer.shard-selectorand aControllerConfigurationOverrider.withShardSelector(...)entry point. - Extend informer configuration and annotation (
@Informer) withshardSelector, propagate it intoInformerEventSourceConfiguration, and apply it inInformerManagerwhen creating namespace-scoped/all-namespaces informers. - Update test scaffolding (mock client) and add basic configuration unit tests for shard selector defaults and builder behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| operator-framework/src/main/java/io/javaoperatorsdk/operator/config/loader/ConfigLoader.java | Adds config bindings for shard selector keys at controller and informer levels. |
| operator-framework-core/src/test/java/io/javaoperatorsdk/operator/MockKubernetesClient.java | Extends Mockito stubbing to support the new withShardSelector(...) call chain. |
| operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/InformerConfigurationTest.java | Adds unit tests for shard selector default value and builder setter behavior. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerManager.java | Applies shard selector to informer client operations and includes it in toString(). |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerEventSourceConfiguration.java | Adds builder support and propagation of shard selector from InformerConfiguration. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java | Introduces shard selector field, builder method, annotation initialization, and getter. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/Informer.java | Extends the @Informer annotation with a shardSelector() attribute and Javadoc. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverrider.java | Adds withShardSelector(...) to allow configuring shard selector at controller override time. |
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
xstefank
approved these changes
Jun 30, 2026
csviri
added a commit
that referenced
this pull request
Jul 1, 2026
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
csviri
added a commit
that referenced
this pull request
Jul 2, 2026
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
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.
Add support for shard selectors for informers; both for ControllerEventSource and InformerEventSource