Skip to content

Commit 6bc2d54

Browse files
committed
fixes2
1 parent 27b0f3f commit 6bc2d54

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,11 @@ args:
9696
volumeMounts:
9797
- name: dind-externals
9898
mountPath: /home/runner/tmpDir
99+
{{ if not (empty .Values.runner.dindInitContainer.resources) }}
99100
resources:
100101
{{- toYaml .Values.runner.dindInitContainer.resources | nindent 2 -}}
101102
{{- end }}
103+
{{- end }}
102104

103105
{{- define "gha-runner-scale-set.dind-container" -}}
104106
image: {{ (.Values.runner.dindContainer).image | default "docker:dind" }}
@@ -127,9 +129,11 @@ volumeMounts:
127129
{{- with (.Values.runner.dindContainer).extraVolumeMounts -}}
128130
{{- toYaml . | nindent 2 -}}
129131
{{- end }}
132+
{{ if not (empty .Values.runner.dindContainer.resources) }}
130133
resources:
131134
{{- toYaml .Values.runner.dindContainer.resources | nindent 2 -}}
132135
{{- end }}
136+
{{- end }}
133137

134138
{{- define "gha-runner-scale-set.dind-volume" -}}
135139
- name: dind-sock
@@ -290,7 +294,7 @@ volumeMounts:
290294
{{- end }}
291295
{{ if not (empty .Values.runner.runnerContainer.resources) }}
292296
resources:
293-
{{- toYaml .Values.runner.dindInitContainer.resources | nindent 2 -}}
297+
{{- toYaml .Values.runner.runnerContainer.resources | nindent 2 -}}
294298
{{- end }}
295299
{{- end }}
296300

@@ -384,7 +388,7 @@ volumeMounts:
384388
{{- end }}
385389
{{ if not (empty .Values.runner.runnerContainer.resources) }}
386390
resources:
387-
{{- toYaml .Values.runner.dindInitContainer.resources | nindent 2 -}}
391+
{{- toYaml .Values.runner.runnerContainer.resources | nindent 2 -}}
388392
{{- end }}
389393
{{- end }}
390394

@@ -449,7 +453,7 @@ volumeMounts:
449453
{{- end }}
450454
{{ if not (empty .Values.runner.runnerContainer.resources) }}
451455
resources:
452-
{{- toYaml .Values.runner.dindInitContainer.resources | nindent 2 -}}
456+
{{- toYaml .Values.runner.runnerContainer.resources | nindent 2 -}}
453457
{{- end}}
454458
{{- end}}
455459

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ spec:
151151
{{- else if eq $containerMode.type "kubernetes" }}
152152
{{- include "gha-runner-scale-set.kubernetes-mode-work-volume" . | nindent 6 }}
153153
{{- include "gha-runner-scale-set.extra-volumes" . | nindent 6 }}
154+
{{- else }}
155+
{{- with .Values.runner.extraVolumes }}
156+
{{- toYaml . | nindent 6 }}
157+
{{- end }}
154158
{{- end }}
155159
{{- end }}
156160
{{- with .Values.runner.extraPodSpec }}

charts/gha-runner-scale-set/tests/template_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func TestTemplateRenderedUserProvideSetServiceAccount(t *testing.T) {
283283
SetValues: map[string]string{
284284
"githubConfigUrl": "https://github.com/actions",
285285
"githubConfigSecret.github_token": "gh_token12345",
286-
"template.spec.serviceAccountName": "test-service-account",
286+
"runner.serviceAccountName": "test-service-account",
287287
"controllerServiceAccount.name": "arc",
288288
"controllerServiceAccount.namespace": "arc-system",
289289
},
@@ -420,14 +420,14 @@ func TestTemplateRenderedAutoScalingRunnerSet_ProvideMetadata(t *testing.T) {
420420
options := &helm.Options{
421421
Logger: logger.Discard,
422422
SetValues: map[string]string{
423-
"githubConfigUrl": "https://github.com/actions",
424-
"githubConfigSecret.github_token": "gh_token12345",
425-
"template.metadata.labels.test1": "test1",
426-
"template.metadata.labels.test2": "test2",
427-
"template.metadata.annotations.test3": "test3",
428-
"template.metadata.annotations.test4": "test4",
429-
"controllerServiceAccount.name": "arc",
430-
"controllerServiceAccount.namespace": "arc-system",
423+
"githubConfigUrl": "https://github.com/actions",
424+
"githubConfigSecret.github_token": "gh_token12345",
425+
"runner.extraMetadata.labels.test1": "test1",
426+
"runner.extraMetadata.labels.test2": "test2",
427+
"runner.extraMetadata.annotations.test3": "test3",
428+
"runner.extraMetadata.annotations.test4": "test4",
429+
"controllerServiceAccount.name": "arc",
430+
"controllerServiceAccount.namespace": "arc-system",
431431
},
432432
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
433433
}
@@ -1781,7 +1781,7 @@ func TestTemplateRenderedAutoScalingRunnerSet_RestartPolicy(t *testing.T) {
17811781
"githubConfigSecret.github_token": "gh_token12345",
17821782
"controllerServiceAccount.name": "arc",
17831783
"controllerServiceAccount.namespace": "arc-system",
1784-
"template.spec.restartPolicy": "Always",
1784+
"runner.restartPolicy": "Always",
17851785
},
17861786
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
17871787
}

charts/gha-runner-scale-set/tests/values_extra_containers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runner:
1111
valueFrom:
1212
fieldRef:
1313
fieldPath: spec.nodeName
14-
extravolumeMounts:
14+
extraVolumeMounts:
1515
- name: work
1616
mountPath: /work
1717
- name: others

0 commit comments

Comments
 (0)