mirror of
https://github.com/actions/actions-runner-controller.git
synced 2026-01-18 09:45:14 +08:00
fix charts and start implementing githubsecret.yaml
This commit is contained in:
28
charts/gha-runner-scale-set-dev/templates/githubsecret.yaml
Normal file
28
charts/gha-runner-scale-set-dev/templates/githubsecret.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
{{- $usesKubernetesSecrets := or (not .Values.secretResolution) (eq .Values.secretResolution.type "kubernetes") -}}
|
||||
|
||||
{{- if and (not $usesKubernetesSecrets) (empty .Values.auth.secretName) -}}
|
||||
{{- fail ".Values.auth.secretName is required when .Values.secretResolution.type is not \"kubernetes\"" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and $usesKubernetesSecrets (empty .Values.auth.secretName) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "github-secret.name" . | quote }}
|
||||
namespace: {{ include "autoscaling-runner-set.namespace" . | quote }}
|
||||
labels:
|
||||
{{- include "github-secret.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
{{- include "github-secret.annotations" . | nindent 4 }}
|
||||
finalizers:
|
||||
- actions.github.com/cleanup-protection
|
||||
type: Opaque
|
||||
data:
|
||||
{{- if not (empty .Values.auth.app.clientId) }}
|
||||
github_app_id: {{ .Values.auth.app.clientId | toString | b64enc }}
|
||||
github_app_installation_id: {{ required ".Values.auth.app.installationId is required when using GitHub App auth" .Values.auth.app.installationId | toString | b64enc }}
|
||||
github_app_private_key: {{ required ".Values.auth.app.privateKey is required when using GitHub App auth" .Values.auth.app.privateKey | toString | b64enc }}
|
||||
{{- else }}
|
||||
github_token: {{ required ".Values.auth.githubToken is required when auth.secretName and auth.app.clientId are not set" .Values.auth.githubToken | toString | b64enc }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user