Skip to content

Add init container and scope-based env-var partitioning#304

Open
derek-etherton-opslevel wants to merge 1 commit into
mainfrom
startup-commands-and-scope
Open

Add init container and scope-based env-var partitioning#304
derek-etherton-opslevel wants to merge 1 commit into
mainfrom
startup-commands-and-scope

Conversation

@derek-etherton-opslevel

@derek-etherton-opslevel derek-etherton-opslevel commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

When a RunnerJob carries InitCommands, schedule a second init container that runs those commands in the job image before the main container starts. Variables on the job can carry a Scope ("init" or "main") that limits which container sees them — unscoped variables go to both.

The init container shares a new "workspace" emptyDir volume with the main container at WorkingDir, so the init phase can clone a repo and the main container picks it up.

Follow up to: OpsLevel/opslevel-go#624 <- CI will fail till we release this and bump in this PR.

When a RunnerJob carries InitCommands, schedule a second init container
that runs those commands in the job image before the main container
starts. Variables on the job can carry a Scope ("init" or "main") that
limits which container sees them — unscoped variables go to both.

The init container shares a new "workspace" emptyDir volume with the
main container at WorkingDir, so the init phase can clone a repo and
the main container picks it up. This lets the OpenCode coding-agent
hold REPO_CLONE_URL inside the init container only, so the agent
container never sees the OAuth token in its env.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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