feat: add ability to remove the .runner file within the helm chart (#126)

fix: https://gitea.com/gitea/helm-actions/issues/73
---------

Co-authored-by: DaanSelen <dselen@systemec.nl>
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/126
This commit is contained in:
DaanSelen
2026-04-09 09:29:43 +00:00
parent 7d6b4aeb72
commit 988382bf8c
3 changed files with 23 additions and 2 deletions

View File

@ -80,8 +80,9 @@ If `.Values.statefulset.dind.rootless: true` is set, then the following will be
| `statefulset.actRunner.pullPolicy` | The Gitea act runner pullPolicy | `IfNotPresent` |
| `statefulset.actRunner.fullOverride` | Completely overrides the image registry, path/image, tag and digest. | `""` |
| `statefulset.actRunner.extraVolumeMounts` | Allows mounting extra volumes in the act runner container | `[]` |
| `statefulset.actRunner.config` | Act runner custom configuration. See [Act Runner documentation](https://docs.gitea.com/usage/actions/act-runner#configuration) for details. | `Too complex. See values.yaml` |
| `statefulset.actRunner.extraEnvs` | Allows adding custom environment variables | `[]` |
| `statefulset.actRunner.flushCache` | whether to clear the .runner (cache) file by creating an extra init container, can slightly increase boot-up time | `false` |
| `statefulset.actRunner.config` | Act runner custom configuration. See [Act Runner documentation](https://docs.gitea.com/usage/actions/act-runner#configuration) for details. | `Too complex. See values.yaml` |
| `statefulset.dind.rootless` | a simple flag to let helm know we are dealing with a rootless dind container | `false` |
| `statefulset.dind.uid` | a field to set the running user id for the rootless dind container, so it knows where to look for the socket | `""` |
| `statefulset.dind.registry` | image registry, e.g. gcr.io,docker.io | `docker.io` |

View File

@ -49,6 +49,23 @@ spec:
{{- if .Values.preExtraInitContainers }}
{{- toYaml .Values.preExtraInitContainers | nindent 8 }}
{{- end }}
{{- if .Values.statefulset.actRunner.flushCache }}
- name: cache-flusher
image: "{{ include "gitea.actions.init.image" . }}"
command:
- sh
- -c
- |
if [[ -f /data/.runner ]]; then
echo "Removing cache at /data/.runner"
rm -v /data/.runner
else
echo "No .runner file to remove"
fi
volumeMounts:
- mountPath: /data
name: data-act-runner
{{- end }}
- name: init-gitea
image: "{{ include "gitea.actions.init.image" . }}"
command:

View File

@ -26,8 +26,9 @@
## @param statefulset.actRunner.pullPolicy The Gitea act runner pullPolicy
## @param statefulset.actRunner.fullOverride Completely overrides the image registry, path/image, tag and digest.
## @param statefulset.actRunner.extraVolumeMounts Allows mounting extra volumes in the act runner container
## @param statefulset.actRunner.config [default: Too complex. See values.yaml] Act runner custom configuration. See [Act Runner documentation](https://docs.gitea.com/usage/actions/act-runner#configuration) for details.
## @param statefulset.actRunner.extraEnvs Allows adding custom environment variables
## @param statefulset.actRunner.flushCache whether to clear the .runner (cache) file by creating an extra init container, can slightly increase boot-up time
## @param statefulset.actRunner.config [default: Too complex. See values.yaml] Act runner custom configuration. See [Act Runner documentation](https://docs.gitea.com/usage/actions/act-runner#configuration) for details.
#
## @param statefulset.dind.rootless [default: false] a simple flag to let helm know we are dealing with a rootless dind container
## @param statefulset.dind.uid a field to set the running user id for the rootless dind container, so it knows where to look for the socket
@ -82,6 +83,8 @@ statefulset:
# fieldRef:
# fieldPath: metadata.name
# See full details: https://gitea.com/gitea/helm-actions/issues/73
flushCache: false
# See full example here: https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml
config: |
log: