Skip to content

feat(run): resolve container image from service config#81

Merged
luthermonson merged 2 commits into
mainfrom
feat/run-image-config
May 25, 2026
Merged

feat(run): resolve container image from service config#81
luthermonson merged 2 commits into
mainfrom
feat/run-image-config

Conversation

@luthermonson
Copy link
Copy Markdown
Contributor

Summary

  • Add --image flag to ephemerd run for explicit container image override
  • When no flag is set, load the service's config.toml and resolve the image via GitHub.DefaultImageFor(os) based on the job's detected platform
  • Fall back to the built-in default (actions-runner:latest) when no config is present
  • Add Image field to workflow.Runner struct so callers can inject the resolved image

Replaces 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:v1 uses explicit image
  • ephemerd run with service config.toml picks up default_image_windows or default_image_linux
  • ephemerd run without config.toml falls back to actions-runner:latest
  • go vet and go test ./pkg/workflow/ ./pkg/config/ pass

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.
@luthermonson luthermonson merged commit 9193f4e into main May 25, 2026
4 checks passed
@luthermonson luthermonson deleted the feat/run-image-config branch May 25, 2026 23:57
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