mirror of
https://github.com/actions/actions-runner-controller.git
synced 2026-01-17 01:04:47 +08:00
add more fields and tests
This commit is contained in:
@@ -63,6 +63,41 @@ Takes a map of user labels and removes the ones with "actions.github.com/" prefi
|
||||
{{- $processed | toYaml -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Takes a map of user annotations and removes reserved ones.
|
||||
|
||||
Reserved annotations are managed by ARC/controllers and should not be set by users:
|
||||
- actions.github.com/cleanup-*
|
||||
- actions.github.com/values-hash
|
||||
*/}}
|
||||
{{- define "gha-process-annotations" -}}
|
||||
{{- $userAnnotations := . -}}
|
||||
{{- $processed := dict -}}
|
||||
{{- range $key, $value := $userAnnotations -}}
|
||||
{{- if not (or (hasPrefix "actions.github.com/cleanup-" $key) (eq $key "actions.github.com/values-hash")) -}}
|
||||
{{- $_ := set $processed $key $value -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $processed | toYaml -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the annotations for the autoscaling runner set.
|
||||
|
||||
Order of precedence:
|
||||
1) resource.all.metadata.annotations
|
||||
2) resource.autoscalingRunnerSet.metadata.annotations
|
||||
Reserved annotations are excluded from both levels.
|
||||
*/}}
|
||||
{{- define "autoscaling-runner-set.annotations" -}}
|
||||
{{- $global := include "gha-process-annotations" (.Values.resource.all.metadata.annotations | default (dict)) | fromYaml -}}
|
||||
{{- $resource := include "gha-process-annotations" (.Values.resource.autoscalingRunnerSet.metadata.annotations | default (dict)) | fromYaml -}}
|
||||
{{- $annotations := mergeOverwrite $global $resource -}}
|
||||
{{- range $k, $v := $annotations }}
|
||||
{{ $k }}: {{ $v | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
|
||||
@@ -5,6 +5,9 @@ metadata:
|
||||
namespace: {{ include "autoscaling-runner-set.namespace" . | quote }}
|
||||
labels:
|
||||
{{- include "autoscaling-runner-set.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
{{- include "autoscaling-runner-set.annotations" . | nindent 4 }}
|
||||
actions.github.com/values-hash: {{ toJson .Values | sha256sum | trunc 63 }}
|
||||
|
||||
spec:
|
||||
githubConfigUrl: {{ required ".Values.auth.url is required" (trimSuffix "/" .Values.auth.url) | quote }}
|
||||
@@ -36,7 +39,7 @@ spec:
|
||||
certificatePath: {{ .Values.secretResolution.azureKeyVault.certificatePath }}
|
||||
secretKey: {{ .Values.secretResolution.azureKeyVault.secretKey }}
|
||||
{{- else }}
|
||||
{{- fail "Unsupported keyVault type: " .Values.secretResolution.type }}
|
||||
{{- fail (printf "Unsupported keyVault type: %s" .Values.secretResolution.type) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -93,5 +96,4 @@ spec:
|
||||
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
# {{- include "container-spec.runner" . | nindent 8 }}
|
||||
containers:
|
||||
Reference in New Issue
Block a user