Render empty arrays for kubernetes-novolume volumes fields

Fixes #4411
This commit is contained in:
Nikola Jokic
2026-04-20 18:43:41 +02:00
parent e0feb3b711
commit f7c50cc9b2
3 changed files with 89 additions and 1 deletions
@@ -468,6 +468,7 @@ env:
{{- if $tlsConfig.runnerMountPath }}
{{- $mountGitHubServerTLS = 1 }}
{{- end }}
{{- if or $container.volumeMounts $mountGitHubServerTLS }}
volumeMounts:
{{- with $container.volumeMounts }}
{{- range $i, $volMount := . }}
@@ -482,6 +483,9 @@ volumeMounts:
mountPath: {{ clean (print $tlsConfig.runnerMountPath "/" $tlsConfig.certificateFrom.configMapKeyRef.key) }}
subPath: {{ $tlsConfig.certificateFrom.configMapKeyRef.key }}
{{- end }}
{{- else }}
volumeMounts: []
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -269,7 +269,7 @@ spec:
{{- include "gha-runner-scale-set.default-mode-runner-containers" . | nindent 6 }}
{{- end }}
{{- $tlsConfig := (default (dict) .Values.githubServerTLS) }}
{{- if or .Values.template.spec.volumes (eq $containerMode.type "dind") (eq $containerMode.type "kubernetes") (eq $containerMode.type "kubernetes-novolume") $tlsConfig.runnerMountPath }}
{{- if or .Values.template.spec.volumes (eq $containerMode.type "dind") (eq $containerMode.type "kubernetes") $tlsConfig.runnerMountPath }}
volumes:
{{- if $tlsConfig.runnerMountPath }}
{{- include "gha-runner-scale-set.tls-volume" $tlsConfig | nindent 6 }}
@@ -286,4 +286,6 @@ spec:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- else if eq $containerMode.type "kubernetes-novolume" }}
volumes: []
{{- end }}