feat(run): resolve container image from service config#81
Merged
Conversation
Add --image flag to `ephemerd run` for explicit image override. When not set, load the service's config.toml and use the provider's default image for the detected platform (e.g. github.default_image_windows). Falls back to the built-in default (actions-runner:latest) when no config is present.
…image
Adds 6 table-style tests for resolveRunImage covering the priority
ladder (flag > service config > empty fallback), the parse-error path,
and the no-config and missing-override cases. configDirGuard saves
and restores the package-level configDir global between cases so each
test can point at its own tempdir.
docs/cli/run.md gains a Flags table row for --image, a new step in
the Behavior list ("Resolve image"), and an example invocation.
Also tightens the resolveRunImage doc comment: it previously claimed
to return the built-in default itself, when the default is actually
applied downstream in workflow.Runner.RunJob — cosmetic but the
prior wording would trip a reader expecting the function to return
"actions-runner:latest" on the empty path.
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.
Summary
--imageflag toephemerd runfor explicit container image overrideconfig.tomland resolve the image viaGitHub.DefaultImageFor(os)based on the job's detected platformactions-runner:latest) when no config is presentImagefield toworkflow.Runnerstruct so callers can inject the resolved imageReplaces the hardcoded image switch from
fix/run-isolation— image selection is now config-driven rather than a Go conditional.Test plan
ephemerd run --image ghcr.io/custom:v1uses explicit imageephemerd runwith service config.toml picks updefault_image_windowsordefault_image_linuxephemerd runwithout config.toml falls back toactions-runner:latestgo vetandgo test ./pkg/workflow/ ./pkg/config/pass