diff --git a/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml b/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml index 715e7ad4..34fd73e5 100644 --- a/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml +++ b/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml @@ -11,23 +11,42 @@ metadata: name: {{ include "gha-runner-scale-set.scale-set-name" . | replace "_" "-" }} namespace: {{ include "gha-runner-scale-set.namespace" . }} labels: + {{- $base := include "gha-runner-scale-set.labels" . | fromYaml }} + {{- $extra := dict "app.kubernetes.io/component" "" }} + {{- $reserved := merge $base $extra }} {{- with .Values.labels }} - {{- toYaml . | nindent 4 }} + {{- range $k, $v := . }} + {{- if not (or (hasKey $reserved $k) (hasPrefix "actions.github.com/" $k)) }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} {{- end }} {{- if $hasCustomResourceMeta }} {{- with .Values.resourceMeta.autoscalingRunnerSet.labels }} - {{- toYaml . | nindent 4 }} + {{- range $k, $v := . }} + {{- if not (or (hasKey $reserved $k) (hasPrefix "actions.github.com/" $k)) }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} {{- end }} {{- end }} app.kubernetes.io/component: "autoscaling-runner-set" {{- include "gha-runner-scale-set.labels" . | nindent 4 }} annotations: {{- with .Values.annotations }} - {{- toYaml . | nindent 4 }} + {{- range $k, $v := . }} + {{- if not (or (hasPrefix "actions.github.com/cleanup-" $k) (eq $k "actions.github.com/values-hash")) }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} {{- end }} {{- if $hasCustomResourceMeta }} {{- with .Values.resourceMeta.autoscalingRunnerSet.annotations }} - {{- toYaml . | nindent 4 }} + {{- range $k, $v := . }} + {{- if not (or (hasPrefix "actions.github.com/cleanup-" $k) (eq $k "actions.github.com/values-hash")) }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} {{- end }} {{- end }} actions.github.com/values-hash: {{ toJson .Values | sha256sum | trunc 63 }} diff --git a/charts/gha-runner-scale-set/templates/githubsecret.yaml b/charts/gha-runner-scale-set/templates/githubsecret.yaml index a9cae74f..b581c5c3 100644 --- a/charts/gha-runner-scale-set/templates/githubsecret.yaml +++ b/charts/gha-runner-scale-set/templates/githubsecret.yaml @@ -6,8 +6,15 @@ metadata: name: {{ include "gha-runner-scale-set.githubsecret" . }} namespace: {{ include "gha-runner-scale-set.namespace" . }} labels: + {{- $base := include "gha-runner-scale-set.labels" . | fromYaml }} + {{- $extra := dict "app.kubernetes.io/component" "" }} + {{- $reserved := merge $base $extra }} {{- with .Values.labels }} - {{- toYaml . | nindent 4 }} + {{- range $k, $v := . }} + {{- if not (or (hasKey $reserved $k) (hasPrefix "actions.github.com/" $k)) }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} {{- end }} {{- if $hasCustomResourceMeta }} {{- with .Values.resourceMeta.githubConfigSecret.labels }} diff --git a/charts/gha-runner-scale-set/templates/kube_mode_role.yaml b/charts/gha-runner-scale-set/templates/kube_mode_role.yaml index 038307c1..753014e7 100644 --- a/charts/gha-runner-scale-set/templates/kube_mode_role.yaml +++ b/charts/gha-runner-scale-set/templates/kube_mode_role.yaml @@ -8,8 +8,15 @@ metadata: name: {{ include "gha-runner-scale-set.kubeModeRoleName" . }} namespace: {{ include "gha-runner-scale-set.namespace" . }} labels: + {{- $base := include "gha-runner-scale-set.labels" . | fromYaml }} + {{- $extra := dict "app.kubernetes.io/component" "" }} + {{- $reserved := merge $base $extra }} {{- with .Values.labels }} - {{- toYaml . | nindent 4 }} + {{- range $k, $v := . }} + {{- if not (or (hasKey $reserved $k) (hasPrefix "actions.github.com/" $k)) }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} {{- end }} {{- if $hasCustomResourceMeta }} {{- with .Values.resourceMeta.kubernetesModeRole.labels }} diff --git a/charts/gha-runner-scale-set/templates/kube_mode_role_binding.yaml b/charts/gha-runner-scale-set/templates/kube_mode_role_binding.yaml index a4416890..3d899a6e 100644 --- a/charts/gha-runner-scale-set/templates/kube_mode_role_binding.yaml +++ b/charts/gha-runner-scale-set/templates/kube_mode_role_binding.yaml @@ -7,8 +7,15 @@ metadata: name: {{ include "gha-runner-scale-set.kubeModeRoleBindingName" . }} namespace: {{ include "gha-runner-scale-set.namespace" . }} labels: + {{- $base := include "gha-runner-scale-set.labels" . | fromYaml }} + {{- $extra := dict "app.kubernetes.io/component" "" }} + {{- $reserved := merge $base $extra }} {{- with .Values.labels }} - {{- toYaml . | nindent 4 }} + {{- range $k, $v := . }} + {{- if not (or (hasKey $reserved $k) (hasPrefix "actions.github.com/" $k)) }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} {{- end }} {{- if $hasCustomResourceMeta }} {{- with .Values.resourceMeta.kubernetesModeRoleBinding.labels }} diff --git a/charts/gha-runner-scale-set/templates/kube_mode_serviceaccount.yaml b/charts/gha-runner-scale-set/templates/kube_mode_serviceaccount.yaml index 5286ff50..0cdd6f91 100644 --- a/charts/gha-runner-scale-set/templates/kube_mode_serviceaccount.yaml +++ b/charts/gha-runner-scale-set/templates/kube_mode_serviceaccount.yaml @@ -18,8 +18,15 @@ metadata: {{- end }} {{- end }} labels: + {{- $base := include "gha-runner-scale-set.labels" . | fromYaml }} + {{- $extra := dict "app.kubernetes.io/component" "" }} + {{- $reserved := merge $base $extra }} {{- with .Values.labels }} - {{- toYaml . | nindent 4 }} + {{- range $k, $v := . }} + {{- if not (or (hasKey $reserved $k) (hasPrefix "actions.github.com/" $k)) }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} {{- end }} {{- if $hasCustomResourceMeta }} {{- with .Values.resourceMeta.kubernetesModeServiceAccount.labels }}