Render empty arrays for kubernetes-novolume volumes fields#4461
Open
nikola-jokic wants to merge 2 commits intomasterfrom
Open
Render empty arrays for kubernetes-novolume volumes fields#4461nikola-jokic wants to merge 2 commits intomasterfrom
nikola-jokic wants to merge 2 commits intomasterfrom
Conversation
Contributor
|
Hello! Thank you for your contribution. Please review our contribution guidelines to understand the project's testing and code conventions. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an invalid rendered AutoscalingRunnerSet manifest when containerMode.type: kubernetes-novolume, where spec.template.spec.volumes and the runner container’s volumeMounts were being emitted as null (YAML key with no list items), which fails Kubernetes schema validation.
Changes:
- Render
spec.template.spec.volumesas an explicit empty array (volumes: []) forkubernetes-novolumewhen no volumes are otherwise required. - Render the runner container
volumeMountsas an explicit empty array (volumeMounts: []) forkubernetes-novolumewhen no mounts are otherwise required. - Add regression tests covering non-nil empty arrays and preservation of user-supplied volumes/volumeMounts in
kubernetes-novolumemode.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml | Ensures volumes is rendered as [] (not null) for kubernetes-novolume when appropriate. |
| charts/gha-runner-scale-set/templates/_helpers.tpl | Ensures runner container volumeMounts is rendered as [] (not null) for kubernetes-novolume when appropriate. |
| charts/gha-runner-scale-set/tests/template_test.go | Adds regression coverage for empty-array rendering and custom override preservation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace SetValues with ValuesFiles for tests that use emptyDir: {}
to avoid Helm CLI's --set limitation that misparses object syntax.
- Create values_k8s_novolume_custom_volumes.yaml
- Create values_k8s_novolume_custom_volume_mounts.yaml
- Update WithCustomVolumes and WithCustomVolumeMounts tests
Fixes test failures introduced in previous commit.
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.
Fixes #4411