@@ -185,7 +185,9 @@ resources:
185
185
{ {- $filtered = append $filtered $volume -} }
186
186
{ {- end -} }
187
187
{ {- end -} }
188
+ { { if not (empty $filtered ) } }
188
189
{ {- toYaml $filtered -} }
190
+ { {- end } }
189
191
{ {- end } }
190
192
191
193
{ {- define " gha-runner-scale-set.extra-containers" -} }
@@ -272,23 +274,25 @@ volumeMounts:
272
274
{ {- end } }
273
275
{ {- end } }
274
276
{ {- toYaml . | nindent 2 -} }
275
- { {- if $mountWork } }
277
+ { {- end } }
278
+ { {- if $mountWork } }
276
279
- name: work
277
280
mountPath: /home/runner/_work
278
- { {- end } }
279
- { {- if $mountDindCert } }
281
+ { {- end } }
282
+ { {- if $mountDindCert } }
280
283
- name: dind-sock
281
284
mountPath: /var/run
282
- { {- end } }
283
- { {- if $mountGitHubServerTLS } }
285
+ { {- end } }
286
+ { {- if $mountGitHubServerTLS } }
284
287
- name: github-server-tls-cert
285
288
mountPath: { { clean (print $tlsConfig .runnerMountPath " /" $tlsConfig .certificateFrom.configMapKeyRef.key) } }
286
289
subPath: { { $tlsConfig .certificateFrom.configMapKeyRef.key } }
287
- { {- end } }
288
290
{ {- end } }
291
+ { { if not (empty .Values.runner.runnerContainer.resources) } }
289
292
resources:
290
293
{ {- toYaml .Values.runner.dindInitContainer.resources | nindent 2 -} }
291
294
{ {- end } }
295
+ { {- end } }
292
296
293
297
{ {- define " gha-runner-scale-set.kubernetes-mode-runner-container" -} }
294
298
image: { { .Values.runner.runnerContainer.image } }
@@ -368,19 +372,86 @@ volumeMounts:
368
372
{ {- end } }
369
373
{ {- end } }
370
374
{ {- toYaml . | nindent 2 -} }
371
- { {- if $mountWork } }
375
+ { {- end } }
376
+ { {- if $mountWork } }
372
377
- name: work
373
378
mountPath: /home/runner/_work
374
- { {- end } }
375
- { {- if $mountGitHubServerTLS } }
379
+ { {- end } }
380
+ { {- if $mountGitHubServerTLS } }
376
381
- name: github-server-tls-cert
377
382
mountPath: { { clean (print $tlsConfig .runnerMountPath " /" $tlsConfig .certificateFrom.configMapKeyRef.key) } }
378
383
subPath: { { $tlsConfig .certificateFrom.configMapKeyRef.key } }
379
- { {- end } }
380
384
{ {- end } }
385
+ { { if not (empty .Values.runner.runnerContainer.resources) } }
381
386
resources:
382
387
{ {- toYaml .Values.runner.dindInitContainer.resources | nindent 2 -} }
383
388
{ {- end } }
389
+ { {- end } }
390
+
391
+ { {- define " gha-runner-scale-set.default-mode-runner-containers" -} }
392
+ image: { { .Values.runner.runnerContainer.image } }
393
+ command: ["/home/runner/run.sh"]
394
+ { { if not (empty .Values.runner.runnerContainer.extraArgs) } }
395
+ args:
396
+ { {- with .Values.runner.runnerContainer.extraArgs } }
397
+ { {- toYaml . | nindent 2 } }
398
+ { {- end } }
399
+ { {- end } }
400
+ { {- $tlsConfig := (default (dict) .Values.githubServerTLS) } }
401
+ { {- $setNodeExtraCaCerts := 0 } }
402
+ { {- $setRunnerUpdateCaCerts := 0 } }
403
+ { {- if $tlsConfig .runnerMountPath } }
404
+ { {- $setNodeExtraCaCerts = 1 } }
405
+ { {- $setRunnerUpdateCaCerts = 1 } }
406
+ { {- end } }
407
+ { {- $mountGitHubServerTLS := 0 } }
408
+ { {- if or .Values.runner.runnerContainer.extraEnv $setNodeExtraCaCerts $setRunnerUpdateCaCerts } }
409
+ env:
410
+ { {- with .Values.runner.runnerContainer.extraEnv } }
411
+ { {- range $i , $env := . } }
412
+ { {- if eq $env .name " NODE_EXTRA_CA_CERTS" } }
413
+ { {- $setNodeExtraCaCerts = 0 } }
414
+ { {- end } }
415
+ { {- if eq $env .name " RUNNER_UPDATE_CA_CERTS" } }
416
+ { {- $setRunnerUpdateCaCerts = 0 } }
417
+ { {- end } }
418
+ { {- end } }
419
+ { {- toYaml . | nindent 2 -} }
420
+ { {- end } }
421
+ { {- if $setNodeExtraCaCerts } }
422
+ - name: NODE_EXTRA_CA_CERTS
423
+ value: { { clean (print $tlsConfig .runnerMountPath " /" $tlsConfig .certificateFrom.configMapKeyRef.key) } }
424
+ { {- end } }
425
+ { {- if $setRunnerUpdateCaCerts } }
426
+ - name: RUNNER_UPDATE_CA_CERTS
427
+ value: "1"
428
+ { {- end } }
429
+ { {- if $tlsConfig .runnerMountPath } }
430
+ { {- $mountGitHubServerTLS = 1 } }
431
+ { {- end } }
432
+ { {- end } }
433
+
434
+ { {- if or .Values.runner.runnerContainer.extraVolumeMounts $mountGitHubServerTLS } }
435
+ volumeMounts:
436
+ { {- with .Values.runner.runnerContainer.extraVolumeMounts } }
437
+ { {- range $i , $volMount := . } }
438
+ { {- if eq $volMount .name " github-server-tls-cert" } }
439
+ { {- $mountGitHubServerTLS = 0 } }
440
+ { {- end } }
441
+ { {- end } }
442
+ { {- toYaml . | nindent 2 -} }
443
+ { {- end } }
444
+ { {- if $mountGitHubServerTLS } }
445
+ - name: github-server-tls-cert
446
+ mountPath: { { clean (print $tlsConfig .runnerMountPath " /" $tlsConfig .certificateFrom.configMapKeyRef.key) } }
447
+ subPath: { { $tlsConfig .certificateFrom.configMapKeyRef.key } }
448
+ { {- end } }
449
+ { {- end } }
450
+ { { if not (empty .Values.runner.runnerContainer.resources) } }
451
+ resources:
452
+ { {- toYaml .Values.runner.dindInitContainer.resources | nindent 2 -} }
453
+ { {- end} }
454
+ { {- end} }
384
455
385
456
{ {- define " gha-runner-scale-set.managerRoleName" -} }
386
457
{ {- include " gha-runner-scale-set.fullname" . } }-manager
0 commit comments