Repository navigation
Description
Summary
The compute driver (openshell-driver-openshift) creates sandbox init containers with command: ["sh", "-c", "cp /openshell-sandbox /opt/openshell/bin/"]. This worked with the old mvp supervisor image (Ubuntu-based), but fails with the mvp-v2 supervisor image which is a scratch/distroless image containing only the static binary — no sh, no cp.
Reproduction
-
Deploy OpenShell with mvp-v2 images:
- Gateway:
ghcr.io/kagenti/openshell/gateway:mvp-v2-3a1bbea - Supervisor:
ghcr.io/kagenti/openshell/supervisor:mvp-v2-9a6a0ed - Compute driver:
ghcr.io/kagenti/openshell-driver-openshift/compute-driver:mvp-a5f33f4
- Gateway:
-
Create a sandbox:
openshell sandbox create --provider claude --no-auto-providers -- claude -
Init container
supervisor-initfails:
exitCode: 128
message: "exec: \"sh\": executable file not found in $PATH"
reason: StartError
Root Cause
The mvp-v2 supervisor Dockerfile switched from a full Ubuntu base to a scratch image. The image only contains /openshell-sandbox — no shell, no coreutils.
The compute driver hardcodes the init container command as:
command: ["sh", "-c", "cp /openshell-sandbox /opt/openshell/bin/ && cp /openshell-sandbox /opt/openshell/bin/"]Proposed Fix
Replace the shell-based copy with a direct binary invocation. Two options:
Option A: Add a copy subcommand to the supervisor binary
The supervisor binary itself could support a copy mode:
// Init container spec
Command: []string{"/openshell-sandbox", "copy", "--to", "/opt/openshell/bin/"}This requires a change in the upstream OpenShell supervisor code (kagenti/OpenShell@mvp-v2).
Option B: Use the binary as its own copier via a static entrypoint
Since the binary is statically linked, use a multi-stage approach where the init container just needs the binary to exist at the destination. The simplest fix is to change the init container to use the image's entrypoint or a direct file path without a shell:
// Use cat-style copy: read binary, write to volume
Command: []string{"/openshell-sandbox"}
Args: []string{"--copy-self", "/opt/openshell/bin/openshell-sandbox"}Option C: Use install from the image (quick fix, needs busybox layer)
Add a busybox layer to the supervisor Dockerfile for the copy operation. Least invasive to driver code but adds image size.
Context
- Tracked by: Update OpenShell deployment to use mvp-v2 branch #1813 (Update OpenShell deployment to use mvp-v2 branch)
- Repo:
kagenti/openshell-driver-openshift(issues disabled there) - The gateway image works correctly with mvp-v2
- The compute driver and credentials driver sidecars are unaffected
- Only the supervisor init container mechanism is broken
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(openshell): upgrade gateway to mvp-v2, fix CLI args for v0.0.49
docs(research): update fork analysis for mvp-v2 — upgrade completed
feat(openshell): update compute driver to v0.1.0-rc.1
[-]openshell-driver-openshift: supervisor init container fails with mvp-v2 scratch image[/-][+]openshell-driver-openshift: supervisor init and sandbox token issues with mvp-v2 images[/+]pdettori commentedon Jun 4, 2026
Update: second issue found — missing sandbox token
The
v0.1.0-rc.1driver fixes the init container (scratch image copy works), but the sandbox supervisor still can't connect back to the gateway:Root Cause
The mvp-v2 supervisor requires an authentication token to establish the relay session back to the gateway. The Kubernetes service account token is already mounted at the default path (
/var/run/secrets/kubernetes.io/serviceaccount/token), but the compute driver doesn't set the env var to tell the supervisor where to find it.Fix
The compute driver should inject this env var into sandbox pods:
{Name: "OPENSHELL_K8S_SA_TOKEN_FILE", Value: "/var/run/secrets/kubernetes.io/serviceaccount/token"}Current status with v0.1.0-rc.1
OPENSHELL_K8S_SA_TOKEN_FILEenv varpdettori commentedon Jun 4, 2026
Update: projected SA token with audience
openshell-gatewayrequiredWith PR #1819 deployed (gateway JWT auth enabled), we confirmed the K8s SA authenticator activates correctly. However the sandbox bootstrap still fails because the compute driver
v0.1.0-rc.2uses the default K8s SA token mount:This token carries audience
https://kubernetes.default.svc.cluster.local. The gateway's TokenReview rejects it:Required fix in compute driver (v0.1.0-rc.3)
The driver must create a projected volume with the correct audience:
Mount at
/var/run/secrets/openshell/tokenand set:Reference:
kagenti/OpenShell@mvp-v2:crates/openshell-driver-kubernetes/src/driver.rs— the upstream in-tree driver uses this exact projected volume configuration.Status
tokenreviews: createfix(openshell): pass projected SA token flags to compute driver
pdettori commentedon Jun 4, 2026
Fix: projected SA token volume — PRs ready
The compute driver fix is implemented and tested:
openshell-driver-openshift (PR #7)
Adds a projected
serviceAccountTokenvolume with:openshell-gateway(matches gateway TokenReview expectation)-sa-token-ttl-secsflag)/var/run/secrets/openshell/tokenOPENSHELL_K8S_SA_TOKEN_FILE=/var/run/secrets/openshell/tokenNew CLI flags:
kagenti/kagenti (PR #1814, latest commit)
-sa-token-audienceand-sa-token-ttl-secsto compute driver in Helm chartv0.1.0-rc.3Next steps
v0.1.0-rc.3→ image buildspdettori commentedon Jun 4, 2026
Update: TokenReview passes, pod annotation mismatch remains
With
v0.1.0-rc.3, the projected token with audienceopenshell-gatewayworks correctly:However,
IssueSandboxTokenstill fails after pod lookup because the gateway expects annotationopenshell.io/sandbox-idon the pod, but the driver sets labelopenshell.ai/sandbox-idinstead.openshell.io/sandbox-idopenshell.ai/sandbox-idopenshell.ioopenshell.aiReference:
kagenti/OpenShell@mvp-v2:crates/openshell-server/src/auth/k8s_sa.rscheckspod.metadata.annotations["openshell.io/sandbox-id"].Fix needed in compute driver (v0.1.0-rc.4)
The driver must set:
The existing label can stay for backwards compat, but the annotation is what the gateway requires.
fix(openshell): bump compute driver to v0.1.0-rc.4
docs(research): update fork analysis for mvp-v2 — upgrade completed
docs(research): update fork analysis for mvp-v2 — upgrade completed
fix(ci): add push-to-main trigger for HyperShift OpenShell workflow