{{ message }}
feat(helm/gha-runner-scale-set-experimental): add $extra field passthrough for runner container in dind and kubernetes modes#4477
Open
stokkie90 wants to merge 3 commits into
Conversation
… and kubernetes modes Mirror the pattern already used in mode-empty and the dind sidecar container: read runner.container as a map, validate known fields, and pass any unrecognised keys (e.g. securityContext, resources, imagePullPolicy) through to the rendered container spec via $extra = omit ... | toYaml. Includes input validation (map/list/unsupported-key guards) and 14 new helm-unittest test cases (7 per mode) covering passthrough, name-override suppression, and validation failure paths.
Add commented examples for env, volumeMounts, args, securityContext, and resources under runner.container, mirroring the existing style of the runner.dind.container section.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds runner.container “extra fields” passthrough for the runner container when using runner.mode: dind and runner.mode: kubernetes, aligning these modes with the existing “mode-empty” behavior and improving configurability of the runner container spec.
Changes:
- Add
omit ... | toYamlpassthrough for non-explicitly-renderedrunner.containerfields in dind + kubernetes runner container templates (while ignoringrunner.container.name). - Add type-guard validation for
runner.containerand selected fields (env,volumeMounts,args,securityContext, and disallowvolumes) in both modes. - Add helm-unittest coverage for passthrough behavior + validation failure paths in both modes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
We would love to be able to extends |
Extract the six runner.container type-guard checks into a reusable named template 'runner.container.validate' in _defaults.tpl. Both _mode_dind.tpl and _mode_kubernetes.tpl now call this helper instead of duplicating the block, preventing future drift. Also fixes _mode_dind.tpl to use $runner := (.Values.runner | default dict) before accessing runner.container, making the failure mode consistent with kubernetes mode when runner itself is overridden to a non-map.
Author
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
dindandkubernetesmodes, the runner container template now readsrunner.containeras a map and passes any fields not explicitly rendered (securityContext,resources,imagePullPolicy,args, etc.) through to the container spec via the$extra = omit ... | toYamlpattern.mode: ""(empty mode) via_mode_empty.tpl, and in the dind sidecar container in_mode_dind.tpl.runner.containermust be a map,env/volumeMounts/argsmust be lists,securityContextmust be a map, andvolumesis rejected with a clear error pointing torunner.pod.spec.volumes.Risks & rollout
runner.containerare unaffected (the map defaults to{}).namekey inrunner.containeris silently ignored to preserve the hardcodedrunnercontainer name.Validation
helm-unittesttest cases added (7 per mode) covering: extra field passthrough, name-override suppression, and all validation failure paths.