mirror of
https://github.com/actions/actions-runner-controller.git
synced 2026-01-06 18:08:04 +08:00
Rename actions-runner-controller-2 and auto-scaling-runner-set helm charts (#2333)
Co-authored-by: Ava S <avastancu@github.com>
This commit is contained in:
39
charts/gha-runner-scale-set/templates/githubsecret.yaml
Normal file
39
charts/gha-runner-scale-set/templates/githubsecret.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
{{- if not (kindIs "string" .Values.githubConfigSecret) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "gha-runner-scale-set.githubsecret" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "gha-runner-scale-set.labels" . | nindent 4 }}
|
||||
finalizers:
|
||||
- actions.github.com/secret-protection
|
||||
data:
|
||||
{{- $hasToken := false }}
|
||||
{{- $hasAppId := false }}
|
||||
{{- $hasInstallationId := false }}
|
||||
{{- $hasPrivateKey := false }}
|
||||
{{- range $secretName, $secretValue := (required "Values.githubConfigSecret is required for setting auth with GitHub server." .Values.githubConfigSecret) }}
|
||||
{{- if $secretValue }}
|
||||
{{ $secretName }}: {{ $secretValue | toString | b64enc }}
|
||||
{{- if eq $secretName "github_token" }}
|
||||
{{- $hasToken = true }}
|
||||
{{- end }}
|
||||
{{- if eq $secretName "github_app_id" }}
|
||||
{{- $hasAppId = true }}
|
||||
{{- end }}
|
||||
{{- if eq $secretName "github_app_installation_id" }}
|
||||
{{- $hasInstallationId = true }}
|
||||
{{- end }}
|
||||
{{- if eq $secretName "github_app_private_key" }}
|
||||
{{- $hasPrivateKey = true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (not $hasToken) (not ($hasAppId)) }}
|
||||
{{- fail "A valid .Values.githubConfigSecret is required for setting auth with GitHub server, provide .Values.githubConfigSecret.github_token or .Values.githubConfigSecret.github_app_id." }}
|
||||
{{- end }}
|
||||
{{- if and $hasAppId (or (not $hasInstallationId) (not $hasPrivateKey)) }}
|
||||
{{- fail "A valid .Values.githubConfigSecret is required for setting auth with GitHub server, provide .Values.githubConfigSecret.github_app_installation_id and .Values.githubConfigSecret.github_app_private_key." }}
|
||||
{{- end }}
|
||||
{{- end}}
|
||||
Reference in New Issue
Block a user