fix: allow DinD image to be configured via valuesl

This change makes the DinD image configurable by checking the container spec for a container named "dind" and using its defined image if present. Defaults to "docker:dind" otherwise.
This commit is contained in:
Yashraj Dighe 2025-04-04 19:30:59 +05:30 committed by GitHub
parent 4ca37fbdf2
commit 0af8cc7caa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 2 deletions

View File

@ -89,14 +89,22 @@ image: {{ $val.image }}
command: ["cp"] command: ["cp"]
args: ["-r", "/home/runner/externals/.", "/home/runner/tmpDir/"] args: ["-r", "/home/runner/externals/.", "/home/runner/tmpDir/"]
volumeMounts: volumeMounts:
- name: dind-externals - name: -externals
mountPath: /home/runner/tmpDir mountPath: /home/runner/tmpDir
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "gha-runner-scale-set.dind-container" -}} {{- 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: args:
- dockerd - dockerd
- --host=unix:///var/run/docker.sock - --host=unix:///var/run/docker.sock