Skip to content

feat: add --sandbox-image-pull-policy flag for sandbox pods#4

Merged
pdettori merged 1 commit intomvpfrom
feat/sandbox-image-pull-policy
May 4, 2026
Merged

feat: add --sandbox-image-pull-policy flag for sandbox pods#4
pdettori merged 1 commit intomvpfrom
feat/sandbox-image-pull-policy

Conversation

@pdettori
Copy link
Copy Markdown

@pdettori pdettori commented May 4, 2026

Summary

  • Adds ImagePullPolicy field to the driver Config struct
  • Adds --sandbox-image-pull-policy CLI flag (accepts Always, IfNotPresent, Never)
  • Applies the policy to both the supervisor init container and the agent container in dynamically-created sandbox pods
  • When unset, Kubernetes default behavior applies (Always for :latest tags)

Motivation

Sandbox pods using :latest images (e.g. sandboxes/base:latest at 1.1GB) default to imagePullPolicy: Always due to Kubernetes default behavior. This causes ~90 second startup delays on every sandbox creation, even when the image is already cached on the node.

The upstream Rust driver (openshell-driver-kubernetes) already supports this via --sandbox-image-pull-policy / OPENSHELL_SANDBOX_IMAGE_PULL_POLICY. This PR brings parity to the OpenShift Go driver.

Usage

compute-driver --sandbox-image-pull-policy=IfNotPresent ...

Test plan

  • Unit test: TestBuildSandboxSpec_ImagePullPolicy — verifies policy is set on both containers
  • Unit test: TestBuildSandboxSpec_ImagePullPolicy_Empty — verifies no field when config is empty
  • Full test suite passes (go test ./...)
  • Integration: deploy with Helm chart passing sandboxImagePullPolicy: IfNotPresent, verify sandbox pod spec

🤖 Generated with Claude Code

The compute driver now accepts a --sandbox-image-pull-policy flag that
sets imagePullPolicy on both the supervisor init container and the agent
container in sandbox pods. When omitted, the Kubernetes default applies
(Always for :latest tags, IfNotPresent otherwise).

This mirrors the upstream Rust driver's OPENSHELL_SANDBOX_IMAGE_PULL_POLICY
env var and allows operators to avoid costly re-pulls of large sandbox
images (e.g. 1.1GB base images) on every pod creation.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@pdettori pdettori merged commit a5f33f4 into mvp May 4, 2026
4 checks passed
@pdettori pdettori deleted the feat/sandbox-image-pull-policy branch May 4, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant