Skip to content

Render empty arrays for kubernetes-novolume volumes fields#4461

Open
nikola-jokic wants to merge 2 commits intomasterfrom
nikola-jokic/fix-kubernetes-novolume-null-array
Open

Render empty arrays for kubernetes-novolume volumes fields#4461
nikola-jokic wants to merge 2 commits intomasterfrom
nikola-jokic/fix-kubernetes-novolume-null-array

Conversation

@nikola-jokic
Copy link
Copy Markdown
Collaborator

Fixes #4411

Copilot AI review requested due to automatic review settings April 20, 2026 16:47
@github-actions
Copy link
Copy Markdown
Contributor

Hello! Thank you for your contribution.

Please review our contribution guidelines to understand the project's testing and code conventions.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.volumes as an explicit empty array (volumes: []) for kubernetes-novolume when no volumes are otherwise required.
  • Render the runner container volumeMounts as an explicit empty array (volumeMounts: []) for kubernetes-novolume when no mounts are otherwise required.
  • Add regression tests covering non-nil empty arrays and preservation of user-supplied volumes/volumeMounts in kubernetes-novolume mode.

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.
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.

containerMode: "kubernetes-novolume" has null volume section which causes error

2 participants