bug: sandbox --label values are stored as metadata but never applied to the pod/container
Nessuno ha ancora preso questa issue.
- Lingua principale
- Rust
- Stelle
- 8.7k
- Fork
- 1.3k
- Merge medio
- 2g 11h
- PR unite (30g)
- 253
Descrizione
Agent Diagnostic
Pointed an agent at the repo and traced the create-sandbox label flow across the gateway and compute drivers (codebase exploration + openshell-cli knowledge).
openshell sandbox create --label k=vsends the label inCreateSandboxRequest.labels(crates/openshell-cli/src/main.rs→run.rs::sandbox_create).- In the gateway,
handle_create_sandbox_inner(crates/openshell-server/src/grpc/sandbox.rs) stores those labels only inObjectMeta.labels(sandbox metadata used for CLI filtering /--selector). They were never copied intoSandboxTemplate.labels. SandboxTemplate.labelsis the backend-neutral field documented as "Labels applied to compute-platform resources", mapped toDriverSandboxTemplate.labelsincrates/openshell-server/src/compute/mod.rs(driver_sandbox_template_from_public).- Drivers consume
template.labels: the Kubernetes driver applies them to pod metadata (crates/openshell-driver-kubernetes/src/driver.rs), the Docker driver to container labels (crates/openshell-driver-docker/src/lib.rs). The VM driver ignores them. - Root cause: the CLI never populates
template.labels, and the gateway never bridgesrequest.labels→template.labels. So there was no path for a user-supplied--labelto reach the pod/container; it only ever became sandbox metadata.
Description
Actual behavior: openshell sandbox create --label env=dev records env=dev as sandbox metadata (visible via openshell sandbox list --selector env=dev), but the label is not applied to the underlying Kubernetes pod (or Docker container). kubectl get pods -l env=dev returns nothing.
Expected behavior: User-supplied labels are applied to the underlying compute resource (pod / container) in addition to being stored as sandbox metadata, so operators can select the workload with native platform tooling.
Reproduction Steps
- Register/select a Kubernetes-backed gateway.
openshell sandbox create --label env=dev -- claudekubectl get pods -l env=dev -n <sandbox-namespace>- Observe: no pod matches the label, even though
openshell sandbox list --selector env=devshows the sandbox.
Environment
- OS: any (code-level bug, platform-independent)
- Compute driver: Kubernetes (Docker affected the same way; VM driver has no label support)
- OpenShell:
mainbranch
Logs
No error is emitted — the labels are silently confined to sandbox metadata.
Agent-First Checklist
- I pointed my agent at the repo and had it investigate this issue
- I loaded relevant skills (e.g.,
openshell-cli) and traced the create-sandbox flow across the gateway and compute drivers - My agent could not resolve this without a code change — the diagnostic above explains the root cause and fix location
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Traccia il flusso di creazione da crates/openshell-cli/src/main.rs e run.rs::sandbox_create fino a handle_create_sandbox_inner in crates/openshell-server/src/grpc/sandbox.rs. Poi esamina driver_sandbox_template_from_public in crates/openshell-server/src/compute/mod.rs e la gestione delle label da parte dei driver Kubernetes e Docker. Il lavoro è completato quando una label fornita dall’utente rimane nei metadati del sandbox e viene applicata anche al pod o container sottostante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, kubernetes, rust
- Ambito
- backend, cli, infrastructure
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 72/100