Skip to content

feat: shard selector support#3429

Merged
csviri merged 5 commits into
operator-framework:nextfrom
csviri:sharding
Jun 30, 2026
Merged

feat: shard selector support#3429
csviri merged 5 commits into
operator-framework:nextfrom
csviri:sharding

Conversation

@csviri

@csviri csviri commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Add support for shard selectors for informers; both for ControllerEventSource and InformerEventSource

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 18, 2026
@csviri csviri changed the base branch from main to next June 18, 2026 14:13
@csviri csviri linked an issue Jun 18, 2026 that may be closed by this pull request
csviri added 2 commits June 29, 2026 21:25
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@csviri csviri marked this pull request as ready for review June 29, 2026 20:07
Copilot AI review requested due to automatic review settings June 29, 2026 20:07
@openshift-ci openshift-ci Bot requested review from metacosm and xstefank June 29, 2026 20:07
@csviri csviri changed the title [WIP] feat: shard selector support feat: shard selector support Jun 29, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 29, 2026

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.

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-selector and a ControllerConfigurationOverrider.withShardSelector(...) entry point.
  • Extend informer configuration and annotation (@Informer) with shardSelector, propagate it into InformerEventSourceConfiguration, and apply it in InformerManager when 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>

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>

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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

@csviri csviri merged commit ec86d69 into operator-framework:next Jun 30, 2026
27 checks passed
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>
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.

Support sharded informers

3 participants