diff --git a/templates/gitea/act_runner/statefulset.yaml b/templates/gitea/act_runner/statefulset.yaml index 46382bf..c4a7fef 100644 --- a/templates/gitea/act_runner/statefulset.yaml +++ b/templates/gitea/act_runner/statefulset.yaml @@ -21,6 +21,8 @@ spec: {{- include "gitea.selectorLabels.actRunner" . | nindent 6 }} template: metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/gitea/act_runner/config-act-runner.yaml") . | sha256sum }} labels: {{- include "gitea.labels.actRunner" . | nindent 8 }} {{- with .Values.actions.statefulset.labels }} diff --git a/unittests/act_runner/statefulset.yaml b/unittests/act_runner/statefulset.yaml index cd350d9..fdcccb8 100644 --- a/unittests/act_runner/statefulset.yaml +++ b/unittests/act_runner/statefulset.yaml @@ -4,6 +4,7 @@ release: namespace: testing templates: - templates/gitea/act_runner/statefulset.yaml + - templates/gitea/act_runner/config-act-runner.yaml tests: - it: doesn't renders a StatefulSet by default template: templates/gitea/act_runner/statefulset.yaml @@ -54,6 +55,23 @@ tests: secretKeyRef: name: "gitea-unittests-actions-token" key: "token" + - it: renders a StatefulSet (that tracks changes of the runner configuration as annotation) + template: templates/gitea/act_runner/statefulset.yaml + set: + actions: + enabled: true + existingSecret: "my-secret" + existingSecretKey: "my-secret-key" + asserts: + - hasDocuments: + count: 1 + - containsDocument: + kind: StatefulSet + apiVersion: apps/v1 + name: gitea-unittests-act-runner + - equal: + path: spec.template.metadata.annotations["checksum/config"] + value: "2a2200e80fc29111d18b675789c265cd3d5f917754850f946f1ce3c55dcd65f8" - it: renders a StatefulSet (with correct GITEA_INSTANCE_URL env with default act-runner specific LOCAL_ROOT_URL) template: templates/gitea/act_runner/statefulset.yaml set: diff --git a/values.yaml b/values.yaml index 2dfb62d..7a811da 100644 --- a/values.yaml +++ b/values.yaml @@ -397,14 +397,12 @@ actions: tag: 0.2.11 pullPolicy: IfNotPresent + # See full example here: https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml config: | log: level: debug cache: enabled: false - runner: - labels: - - "ubuntu-latest" dind: repository: docker