diff --git a/charts/gha-runner-scale-set/templates/_helpers.tpl b/charts/gha-runner-scale-set/templates/_helpers.tpl index bd71ed64c9..40e98750b8 100644 --- a/charts/gha-runner-scale-set/templates/_helpers.tpl +++ b/charts/gha-runner-scale-set/templates/_helpers.tpl @@ -96,7 +96,14 @@ volumeMounts: {{- end }} {{- define "gha-runner-scale-set.dind-container" -}} -image: docker:dind +{{- $dindImage := "docker:dind" -}} +{{- range $i, $val := .Values.template.spec.containers }} + {{- if eq $val.name "dind" }} + {{- $dindImage = $val.image }} + {{- end }} +{{- end }} + +image: {{ $dindImage }} args: - dockerd - --host=unix:///var/run/docker.sock @@ -170,14 +177,6 @@ volumeMounts: {{- end }} {{- end }} -{{- define "gha-runner-scale-set.non-runner-containers" -}} - {{- range $i, $container := .Values.template.spec.containers }} - {{- if ne $container.name "runner" }} -- {{ $container | toYaml | nindent 2 }} - {{- end }} - {{- end }} -{{- end }} - {{- define "gha-runner-scale-set.non-runner-non-dind-containers" -}} {{- range $i, $container := .Values.template.spec.containers }} {{- if and (ne $container.name "runner") (ne $container.name "dind") }} diff --git a/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml b/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml index 39ebfef800..f7d40b8247 100644 --- a/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml +++ b/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml @@ -141,7 +141,7 @@ spec: {{- else if eq $containerMode.type "kubernetes" }} - name: runner {{- include "gha-runner-scale-set.kubernetes-mode-runner-container" . | nindent 8 }} - {{- include "gha-runner-scale-set.non-runner-containers" . | nindent 6 }} + {{- include "gha-runner-scale-set.non-runner-non-dind-containers" . | nindent 6 }} {{- else }} {{- include "gha-runner-scale-set.default-mode-runner-containers" . | nindent 6 }} {{- end }}