Skip to content

Sandbox-manager support filtering sandbox-related custom resources#217

Open
lxs137 wants to merge 1 commit intoopenkruise:masterfrom
lxs137:manager/scoped-informer
Open

Sandbox-manager support filtering sandbox-related custom resources#217
lxs137 wants to merge 1 commit intoopenkruise:masterfrom
lxs137:manager/scoped-informer

Conversation

@lxs137
Copy link

@lxs137 lxs137 commented Mar 21, 2026

Ⅰ. Describe what this PR does

Sandbox-manager support filtering sandbox-related custom resources (Sandbox, SandboxSet, Checkpoint, SandboxTemplate) by namespace and label selector through startup flags, enabling:

  • Multi-tenancy isolation: Different controller instances manage resources with different labels, avoiding conflicts between tenants.
  • Horizontal sharding: In large-scale clusters, resources can be sharded by label across multiple controller instances, reducing the pressure on a single instance.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

  1. Namespace filtering: Start sandbox-manager with --sandbox-namespace=<target-ns>, verify that only resources in the specified namespace are watched and managed.
  2. Label selector filtering: Start sandbox-manager with --sandbox-label-selector=managed=true, verify that only resources with matching labels are watched.
  3. Default behavior (no flags): Start without either flag, verify all resources across all namespaces are managed as before (backward compatible).

Ⅳ. Special notes for reviews

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kruise-bot
Copy link

Welcome @lxs137! It looks like this is your first PR to openkruise/agents 🎉

@lxs137 lxs137 changed the title Support sandbox-namespace and sandbox-label-selector flags for resource filtering Sandbox-manager support filtering sandbox-related custom resources Mar 21, 2026
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.80%. Comparing base (95ba21c) to head (8989e3b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #217      +/-   ##
==========================================
+ Coverage   61.72%   61.80%   +0.07%     
==========================================
  Files         104      104              
  Lines        6681     6694      +13     
==========================================
+ Hits         4124     4137      +13     
  Misses       2290     2290              
  Partials      267      267              
Flag Coverage Δ
unittests 61.80% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lxs137 lxs137 force-pushed the manager/scoped-informer branch 2 times, most recently from d7e9dba to 143f764 Compare March 21, 2026 15:13
…ce informer

Signed-off-by: menya <lxs137@hotmail.com>
@lxs137 lxs137 force-pushed the manager/scoped-informer branch from 143f764 to 8989e3b Compare March 21, 2026 15:14
@lxs137
Copy link
Author

lxs137 commented Mar 21, 2026

@furykerry @AiRanthem please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants