Skip to content

workloadmanager: propagate CodeInterpreter template metadata to warm pool pods - #474

Open
CapThunder19 wants to merge 1 commit into
volcano-sh:mainfrom
CapThunder19:fix/codeinterpreter-warmpool-pod-metadata
Open

CapThunder19 wants to merge 1 commit into
volcano-sh:mainfrom
CapThunder19:fix/codeinterpreter-warmpool-pod-metadata

Conversation

@CapThunder19

Copy link
Copy Markdown

What type of PR is this

/kind bug

What this PR does / why we need it

When warmPoolSize > 0, a CodeInterpreter's template.labels and template.annotations never reached the sandbox pods. convertToPodTemplate built the SandboxTemplate's pod spec but left its metadata empty, so warm-pool pods were created without them. The direct (non-warm-pool) path already applies them, so turning on a warm pool silently changed what ended up on the pod

This PR

  • sets ObjectMeta (labels and annotations) on the SandboxTemplate's pod template in convertToPodTemplate. The maps are copied so the informer-cached CodeInterpreter is never modified, and empty maps are stored as nil to match what the API server returns.
  • makes podTemplateEqual compare metadata as well as the spec, so adding or changing labels on an existing CodeInterpreter updates its SandboxTemplate.

agent-sandbox already copies template metadata onto warm-pool pods, so no change is needed on that side.

Which issue(s) this PR fixes

Fixes #471

Special notes for your reviewer

  • Tests: added table-driven unit tests covering metadata being copied, nil/empty maps, the cached object not being mutated, a new template getting metadata, an existing template being updated when only metadata changes, and no update for CodeInterpreters without metadata. The new metadata tests fail without the fix, and go test ./pkg/workloadmanager/ passes. I couldn't run make lint locally (Windows), so I'm relying on CI for that.
  • Existing CodeInterpreters that already set template labels or annotations will get their SandboxTemplate updated after upgrade, so agent-sandbox may recreate their warm-pool pods once. CodeInterpreters without template metadata are not affected.
  • I left the container name as is. It's codeinterpreter in the warm-pool path and code-interpreter in the direct path. Renaming it would change every existing SandboxTemplate and recreate everyone's warm-pool pods, so I think it's better done separately if we want it

Does this PR introduce a user-facing change?

CodeInterpreter template labels and annotations are now applied to warm pool sandbox pods, matching the behavior when no warm pool is used.

…pool pods

Signed-off-by: Anirudh <anirudhpatwal19@gmail.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 08:23
@volcano-sh-bot volcano-sh-bot added the kind/bug Something isn't working label Sep 30, 2026
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yaozengzeng for approval. For more information see the Kubernetes Code Review Process.

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

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

Welcome @CapThunder19! It looks like this is your first PR to volcano-sh/agentcube 🎉

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.28%. Comparing base (5903457) to head (1a6c5f8).
⚠️ Report is 16 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #474      +/-   ##
==========================================
+ Coverage   59.98%   60.28%   +0.29%     
==========================================
  Files          36       35       -1     
  Lines        3589     3626      +37     
==========================================
+ Hits         2153     2186      +33     
- Misses       1216     1218       +2     
- Partials      220      222       +2     
Flag Coverage Δ
unittests 60.28% <100.00%> (+0.29%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

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

Labels

kind/bug Something isn't working size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CodeInterpreter template.labels and template.annotations are ignored when warmPoolSize > 0

4 participants