From c8577fa892250193ea511d5246e628d21b47c045 Mon Sep 17 00:00:00 2001 From: Daan Selen Date: Wed, 1 Apr 2026 21:21:01 +0200 Subject: [PATCH] chore: support preinit and postinit container like the helm-gitea --- templates/statefulset.yaml | 8 +++++++- values.yaml | 18 +++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/templates/statefulset.yaml b/templates/statefulset.yaml index 9157d8e..1541ed8 100644 --- a/templates/statefulset.yaml +++ b/templates/statefulset.yaml @@ -30,9 +30,13 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} spec: + restartPolicy: Always securityContext: {{- toYaml .Values.statefulset.securityContext | nindent 8 }} initContainers: + {{- if .Values.preExtraInitContainers }} + {{- toYaml .Values.preExtraInitContainers | nindent 8 }} + {{- end }} - name: init-gitea image: "{{ include "gitea.actions.init.image" . }}" command: @@ -83,7 +87,9 @@ spec: {{- with .Values.statefulset.dind.extraVolumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} - restartPolicy: Always + {{- if .Values.postExtraInitContainers }} + {{- toYaml .Values.postExtraInitContainers | nindent 8 }} + {{- end }} containers: - name: act-runner image: "{{ include "gitea.actions.actRunner.image" . }}" diff --git a/values.yaml b/values.yaml index 2429dd6..7aebdd2 100644 --- a/values.yaml +++ b/values.yaml @@ -116,11 +116,23 @@ init: ## Specify an existing token secret ## -existingSecret: "" -existingSecretKey: "" +existingSecret: "secret" +existingSecretKey: "key" ## Specify the root URL of the Gitea instance -giteaRootURL: "" +giteaRootURL: "gitea.com" + +## @param preExtraInitContainers Additional init containers to run in the pod before gitea-actions runs it owns init containers. +preExtraInitContainers: [] +# - name: pre-init-container +# image: docker.io/library/busybox +# command: [ /bin/sh, -c, 'echo "Hello world! I am a pre init container."' ] + +## @param postExtraInitContainers Additional init containers to run in the pod after gitea-actions runs it owns init containers. +postExtraInitContainers: [] +# - name: post-init-container +# image: docker.io/library/busybox +# command: [ /bin/sh, -c, 'echo "Hello world! I am a post init container."' ] ## @section Global #