Skip to content

Add RunnerJob.InitCommands/InitImage and RunnerJobVariable.Scope#624

Merged
derek-etherton-opslevel merged 2 commits into
mainfrom
startup-commands-and-scope
Jun 30, 2026
Merged

Add RunnerJob.InitCommands/InitImage and RunnerJobVariable.Scope#624
derek-etherton-opslevel merged 2 commits 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

Adds two new fields for configuring the initContainer of a RunnerJob: RunnerJob.InitCommands/InitImage

Also adds a new scope field to RunnerJobVariable with possible values of "", "init", or "main", allowing the partitioning of variables to the init or main container. "", the default value, will just include variables in both containers.

opslevel-runner changes supporting these additions to follow

Pre-requisite for: OpsLevel/opslevel-runner#304

derek-etherton-opslevel and others added 2 commits June 29, 2026 09:36
These fields let opslevel-runner spin up a startup init container alongside
the main job container and partition env vars so credentialed variables can
be scoped to the init phase only. Used by the OpenCode coding-agent to hold
REPO_CLONE_URL inside an init container that the agent container never sees.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Match Kubernetes-native terminology (init container, initContainers in the
pod spec). Avoids confusion with K8s's unrelated startupProbe concept.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread job.go
Variables []RunnerJobVariable `json:"variables"`
Files []RunnerJobFile `json:"files"`
InitCommands []string `json:"initCommands"`
InitImage string `json:"initImage"`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initImage is not technically required at present, but could be handy in short order

@derek-etherton-opslevel derek-etherton-opslevel changed the title Add RunnerJob.StartupCommands/StartupImage and RunnerJobVariable.Scope Add RunnerJob.InitCommands/InitImage and RunnerJobVariable.Scope Jun 29, 2026
Comment thread job.go

const (
RunnerJobVariableScopeInit RunnerJobVariableScope = "init"
RunnerJobVariableScopeMain RunnerJobVariableScope = "main"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presumably we could also extend it with sidecar or something too!

@derek-etherton-opslevel derek-etherton-opslevel merged commit 98ab5ab into main Jun 30, 2026
4 checks passed
@derek-etherton-opslevel derek-etherton-opslevel deleted the startup-commands-and-scope branch June 30, 2026 14:16
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.

2 participants