Fix runner label issues (#739)
### Description of the change This addresses 2 bugs regarding configured runner labels: - `Cannot find: node in PATH` due to a default label that matches the runner host, not the docker-in-docker environment - After changing the runner config, users have to manually replace the StatefulSet Pod of the runner ### Benefits - Out-of-the-box functioning node environment - Auto-updated runner config on changes in values ### Applicable issues - fixes https://gitea.com/gitea/helm-chart/issues/728 - fixes https://gitea.com/gitea/helm-chart/issues/725 ### Additional information With removing the default labels from `values.yaml`, the act runner defaults will be used for new runners which fixes the "missing node" issue. I had issues replacing the labels once the Chart defaults were used, so users might have to replace their runner manually if this is an issue. ### Checklist - [x] Templating unittests are added Signed-off-by: justusbunsi <sk.bunsenbrenner@gmail.com> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/739 Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com> Co-committed-by: justusbunsi <sk.bunsenbrenner@gmail.com>
This commit is contained in:
@ -21,6 +21,8 @@ spec:
|
|||||||
{{- include "gitea.selectorLabels.actRunner" . | nindent 6 }}
|
{{- include "gitea.selectorLabels.actRunner" . | nindent 6 }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
checksum/config: {{ include (print $.Template.BasePath "/gitea/act_runner/config-act-runner.yaml") . | sha256sum }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "gitea.labels.actRunner" . | nindent 8 }}
|
{{- include "gitea.labels.actRunner" . | nindent 8 }}
|
||||||
{{- with .Values.actions.statefulset.labels }}
|
{{- with .Values.actions.statefulset.labels }}
|
||||||
|
@ -4,6 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/act_runner/statefulset.yaml
|
- templates/gitea/act_runner/statefulset.yaml
|
||||||
|
- templates/gitea/act_runner/config-act-runner.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: doesn't renders a StatefulSet by default
|
- it: doesn't renders a StatefulSet by default
|
||||||
template: templates/gitea/act_runner/statefulset.yaml
|
template: templates/gitea/act_runner/statefulset.yaml
|
||||||
@ -54,6 +55,24 @@ tests:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: "gitea-unittests-actions-token"
|
name: "gitea-unittests-actions-token"
|
||||||
key: "token"
|
key: "token"
|
||||||
|
- it: renders a StatefulSet (that tracks changes of the runner configuration as annotation)
|
||||||
|
template: templates/gitea/act_runner/statefulset.yaml
|
||||||
|
set:
|
||||||
|
image.tag: "1.22.3" # lock image tag to prevent test failures on future Gitea upgrades
|
||||||
|
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)
|
- 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
|
template: templates/gitea/act_runner/statefulset.yaml
|
||||||
set:
|
set:
|
||||||
|
@ -397,14 +397,12 @@ actions:
|
|||||||
tag: 0.2.11
|
tag: 0.2.11
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
# See full example here: https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml
|
||||||
config: |
|
config: |
|
||||||
log:
|
log:
|
||||||
level: debug
|
level: debug
|
||||||
cache:
|
cache:
|
||||||
enabled: false
|
enabled: false
|
||||||
runner:
|
|
||||||
labels:
|
|
||||||
- "ubuntu-latest"
|
|
||||||
|
|
||||||
dind:
|
dind:
|
||||||
repository: docker
|
repository: docker
|
||||||
|
Reference in New Issue
Block a user