Add RunnerJob.InitCommands/InitImage and RunnerJobVariable.Scope#624
Merged
Conversation
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>
| Variables []RunnerJobVariable `json:"variables"` | ||
| Files []RunnerJobFile `json:"files"` | ||
| InitCommands []string `json:"initCommands"` | ||
| InitImage string `json:"initImage"` |
Contributor
Author
There was a problem hiding this comment.
initImage is not technically required at present, but could be handy in short order
|
|
||
| const ( | ||
| RunnerJobVariableScopeInit RunnerJobVariableScope = "init" | ||
| RunnerJobVariableScopeMain RunnerJobVariableScope = "main" |
Contributor
There was a problem hiding this comment.
presumably we could also extend it with sidecar or something too!
jasonopslevel
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two new fields for configuring the
initContainerof a RunnerJob:RunnerJob.InitCommands/InitImageAlso adds a new
scopefield toRunnerJobVariablewith 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-runnerchanges supporting these additions to followPre-requisite for: OpsLevel/opslevel-runner#304