Skip to content

Commit 064039a

Browse files
authored
Ignore extra dind container when contaerinMode.type=dind. (#2418)
1 parent e5d8d65 commit 064039a

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

.github/workflows/e2e-test-linux-vm.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ jobs:
439439
--set githubConfigUrl="https://github.com/${{ steps.resolved_inputs.outputs.TARGET_ORG }}/${{steps.resolved_inputs.outputs.TARGET_REPO}}" \
440440
--set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \
441441
--set containerMode.type="kubernetes" \
442+
--set containerMode.kubernetesModeWorkVolumeClaim.accessModes={"ReadWriteOnce"} \
442443
--set containerMode.kubernetesModeWorkVolumeClaim.storageClassName="openebs-hostpath" \
444+
--set containerMode.kubernetesModeWorkVolumeClaim.resources.requests.storage="1Gi" \
443445
./charts/gha-runner-scale-set \
444446
--debug
445447
echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT

apis/actions.github.com/v1alpha1/autoscalingrunnerset_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ type AutoscalingRunnerSetStatus struct {
248248
}
249249

250250
func (ars *AutoscalingRunnerSet) ListenerSpecHash() string {
251-
type listenerSpec = AutoscalingRunnerSetSpec
252251
arsSpec := ars.Spec.DeepCopy()
253252
spec := arsSpec
254253
return hash.ComputeTemplateHash(&spec)

charts/gha-runner-scale-set/templates/_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ volumeMounts:
163163
{{- end }}
164164
{{- end }}
165165

166+
{{- define "gha-runner-scale-set.non-runner-non-dind-containers" -}}
167+
{{- range $i, $container := .Values.template.spec.containers }}
168+
{{- if and (ne $container.name "runner") (ne $container.name "dind") }}
169+
- {{ $container | toYaml | nindent 2 }}
170+
{{- end }}
171+
{{- end }}
172+
{{- end }}
173+
166174
{{- define "gha-runner-scale-set.dind-runner-container" -}}
167175
{{- $tlsConfig := (default (dict) .Values.githubServerTLS) }}
168176
{{- range $i, $container := .Values.template.spec.containers }}

charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ spec:
111111
{{- include "gha-runner-scale-set.dind-runner-container" . | nindent 8 }}
112112
- name: dind
113113
{{- include "gha-runner-scale-set.dind-container" . | nindent 8 }}
114-
{{- include "gha-runner-scale-set.non-runner-containers" . | nindent 6 }}
114+
{{- include "gha-runner-scale-set.non-runner-non-dind-containers" . | nindent 6 }}
115115
{{- else if eq .Values.containerMode.type "kubernetes" }}
116116
- name: runner
117117
{{- include "gha-runner-scale-set.kubernetes-mode-runner-container" . | nindent 8 }}

charts/gha-runner-scale-set/values.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ template:
8686
## template:
8787
## spec:
8888
## initContainers:
89-
## - name: initExternalsInternalVolume
89+
## - name: init-dind-externals
9090
## image: ghcr.io/actions/actions-runner:latest
9191
## command: ["cp", "-r", "-v", "/home/runner/externals/.", "/home/runner/tmpDir/"]
9292
## volumeMounts:
93-
## - name: externalsInternal
93+
## - name: dind-externals
9494
## mountPath: /home/runner/tmpDir
9595
## containers:
9696
## - name: runner
@@ -103,28 +103,28 @@ template:
103103
## - name: DOCKER_CERT_PATH
104104
## value: /certs/client
105105
## volumeMounts:
106-
## - name: workingDirectoryInternal
106+
## - name: work
107107
## mountPath: /home/runner/_work
108-
## - name: dinDInternal
108+
## - name: dind-cert
109109
## mountPath: /certs/client
110110
## readOnly: true
111111
## - name: dind
112112
## image: docker:dind
113113
## securityContext:
114114
## privileged: true
115115
## volumeMounts:
116-
## - mountPath: /certs/client
117-
## name: dinDInternal
118-
## - mountPath: /home/runner/_work
119-
## name: workingDirectoryInternal
120-
## - mountPath: /home/runner/externals
121-
## name: externalsInternal
116+
## - name: work
117+
## mountPath: /home/runner/_work
118+
## - name: dind-cert
119+
## mountPath: /certs/client
120+
## - name: dind-externals
121+
## mountPath: /home/runner/externals
122122
## volumes:
123-
## - name: dinDInternal
123+
## - name: work
124124
## emptyDir: {}
125-
## - name: workingDirectoryInternal
125+
## - name: dind-cert
126126
## emptyDir: {}
127-
## - name: externalsInternal
127+
## - name: dind-externals
128128
## emptyDir: {}
129129
######################################################################################################
130130
## with containerMode.type=kubernetes, we will populate the template.spec with following pod spec

0 commit comments

Comments
 (0)