volcano-sh / volcano-sh/agentcube

CodeInterpreter controller can delete unowned SandboxTemplate resources

Open
#449 1 comment 0 reactions 1 assignee View on GitHub

@avinxshKD is already working on this.

Since Aug 2, 2026.

kind/bug
Dominant language
Go
Stars
167
Forks
88
Avg merge
44m
Merged PRs (30d)
1

Description

What happened:

The CodeInterpreter controller assumes that any SandboxTemplate or SandboxWarmPool with the same namespace/name belongs to the CodeInterpreter.

Existing resources are updated without checking their owner reference. When warmPoolSize is zero, the same-named resources are deleted unconditionally. This can overwrite or delete resources created by another user or controller.

What you expected to happen:

The controller should only update or delete resources controlled by that CodeInterpreter. A name collision with an unowned resource should fail reconciliation and report a condition/event.

How to reproduce it (as minimally and precisely as possible):

  1. Create a standalone SandboxTemplate named test.

  2. Create a CodeInterpreter named test in the same namespace with a valid template and warmPoolSize: 0.

  3. Wait for the CodeInterpreter controller to reconcile.

  4. Run:

    kubectl get sandboxtemplate test

The original template is deleted.

The update path can also be reproduced with warmPoolSize: 1; the existing template spec is overwritten while its ownership is never verified.

Anything else we need to know?:

SetControllerReference is only called when creating a new child. The existing-resource update and delete paths do not check metav1.IsControlledBy or the controller UID.

Relevant code:
https://github.com/volcano-sh/agentcube/blob/0704bb96502af32f2bd90d47f1e11b4c8099959e/pkg/workloadmanager/codeinterpreter_controller.go#L143-L280

Environment:

  • agentcube version: main (0704bb9)
  • Kubernetes version: not version-specific
  • Others: agent-sandbox v0.4.6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.