feat(deployment): support further initContainers

The following patch intoduce the dictionaries pre and postExtraInitContainers.
The dictionaries can be used to specify further initContainers before and after
the gitea initializing process. For example:

```yaml
postExtraInitContainers:
- name: foo
  image: docker.io/library/busybox:latest
preExtraInitContainers:
- name: bar
  image: docker.io/library/busybox:latest
```
This commit is contained in:
kostovicmb
2025-07-31 13:14:46 +00:00
committed by Markus Pesch
parent f786359136
commit 4cfcbd729f
4 changed files with 83 additions and 4 deletions

View File

@ -59,6 +59,9 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
{{- if .Values.preExtraInitContainers }}
{{- toYaml .Values.preExtraInitContainers | nindent 8 }}
{{- end }}
- name: init-directories
image: "{{ include "gitea.image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
@ -98,7 +101,7 @@ spec:
- name: init-app-ini
image: "{{ include "gitea.image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
command:
- "{{ .Values.initContainersScriptsVolumeMountPath }}/config_environment.sh"
env:
- name: GITEA_APP_INI
@ -143,7 +146,7 @@ spec:
{{- if .Values.signing.enabled }}
- name: configure-gpg
image: "{{ include "gitea.image" . }}"
command:
command:
- "{{ .Values.initContainersScriptsVolumeMountPath }}/configure_gpg_environment.sh"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
@ -272,6 +275,9 @@ spec:
{{- include "gitea.init-additional-mounts" . | nindent 12 }}
resources:
{{- toYaml .Values.initContainers.resources | nindent 12 }}
{{- if .Values.postExtraInitContainers }}
{{- toYaml .Values.postExtraInitContainers | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }}
containers:
- name: {{ .Chart.Name }}