feat!: remove extraInitVolumeMounts in favour of per init container volumeMounts

Every chart-managed init container already exposes its own `volumeMounts` through the linked configuration block, so
`extraInitVolumeMounts` added a second way to express the same thing. It was also the only mount setting left outside
of `deployment`, which made the mount configuration harder to discover than it needed to be.

Worse, the name promised more than it delivered. The value was only injected into the four linked init containers and
never reached an init container added through `deployment.initContainers[].container`, even though that is exactly
what a reader would expect from a setting called "extra init volume mounts". The documented use case does not need
the fan-out either: the sample `initPreScript` copies the Postgres client certificate onto the `data` volume, so a
single mount on `deployment.initDirectories.volumeMounts` is enough and the later containers pick it up via /data.

With the value gone the `gitea.init-additional-mounts` helper has no purpose left and is removed together with its
four call sites, which now rely on the already existing `volumeMounts` block of the respective init container.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-10-03 19:30:50 +02:00
co-authored by Copilot
parent c96e5d4132
commit 93a576ca11
6 changed files with 43 additions and 35 deletions
+13 -5
View File
@@ -19,6 +19,7 @@
- [Gateway API](#gateway-api) - [Gateway API](#gateway-api)
- [Session, Cache and Queue](#session-cache-and-queue) - [Session, Cache and Queue](#session-cache-and-queue)
- [Single-Pod Configurations](#single-pod-configurations) - [Single-Pod Configurations](#single-pod-configurations)
- [Additional _app.ini_ settings](#additional-appini-settings)
- [User defined environment variables in app.ini](#user-defined-environment-variables-in-appini) - [User defined environment variables in app.ini](#user-defined-environment-variables-in-appini)
- [External Database](#external-database) - [External Database](#external-database)
- [Ports and external url](#ports-and-external-url) - [Ports and external url](#ports-and-external-url)
@@ -1288,7 +1289,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
### Persistence ### Persistence
| Name | Description | Value | | Name | Description | Value |
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------- | | --------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------- |
| `persistence.enabled` | Enable persistent storage. | `false` | | `persistence.enabled` | Enable persistent storage. | `false` |
| `persistence.existingPersistentVolumeClaim.enabled` | Enable using an existing persistent volume claim. | `false` | | `persistence.existingPersistentVolumeClaim.enabled` | Enable using an existing persistent volume claim. | `false` |
| `persistence.existingPersistentVolumeClaim.persistentVolumeClaimName` | Name of the existing persistent volume claim to use. | `""` | | `persistence.existingPersistentVolumeClaim.persistentVolumeClaimName` | Name of the existing persistent volume claim to use. | `""` |
@@ -1300,7 +1301,6 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
| `persistence.new.storageClassName` | Name of the storage class to use for the new persistent volume claim. | `""` | | `persistence.new.storageClassName` | Name of the storage class to use for the new persistent volume claim. | `""` |
| `persistence.new.subPath` | Subdirectory of the volume to mount at for the new persistent volume claim. | `""` | | `persistence.new.subPath` | Subdirectory of the volume to mount at for the new persistent volume claim. | `""` |
| `extraContainers` | Additional sidecar containers to run in the pod. | `[]` | | `extraContainers` | Additional sidecar containers to run in the pod. | `[]` |
| `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` |
### Init ### Init
@@ -1466,6 +1466,7 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
- All Secrets created by this chart are now configured through the new `secrets` section. - All Secrets created by this chart are now configured through the new `secrets` section.
It exposes `annotations`, `labels`, a checksum-annotation toggle and an `existingSecret` reference for each of the It exposes `annotations`, `labels`, a checksum-annotation toggle and an `existingSecret` reference for each of the
`admin`, `config`, `gpg`, `init`, `inlineConfig` and `metrics` Secrets. `admin`, `config`, `gpg`, `init`, `inlineConfig` and `metrics` Secrets.
- The `gitea.admin` object has been replaced by `secrets.admin`. - The `gitea.admin` object has been replaced by `secrets.admin`.
The chart fails to render if `gitea.admin` is still set. The chart fails to render if `gitea.admin` is still set.
Migrate as follows: Migrate as follows:
@@ -1486,6 +1487,7 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
Admin user handling was previously skipped implicitly when neither an existing Secret nor a username and password were Admin user handling was previously skipped implicitly when neither an existing Secret nor a username and password were
set. It is now controlled explicitly via `secrets.admin.enabled`. set. It is now controlled explicitly via `secrets.admin.enabled`.
- The top-level `signing` object has been replaced by `secrets.gpg`. - The top-level `signing` object has been replaced by `secrets.gpg`.
The chart fails to render if `signing` is still set. The chart fails to render if `signing` is still set.
Migrate as follows: Migrate as follows:
@@ -1513,9 +1515,15 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
- `extraVolumeMounts` has been removed. Deprecated since 6.0.0, it mounted the same volumes into the init containers - `extraVolumeMounts` has been removed. Deprecated since 6.0.0, it mounted the same volumes into the init containers
and into the Gitea container, and it was silently ignored as soon as `extraInitVolumeMounts` or and into the Gitea container, and it was silently ignored as soon as `extraInitVolumeMounts` or
`deployment.gitea.volumeMounts` contained a single entry. Split the mounts explicitly: use `extraInitVolumeMounts` `deployment.gitea.volumeMounts` contained a single entry. Split the mounts explicitly: use
for the init containers and `deployment.gitea.volumeMounts` for the Gitea container. Volumes that are needed in both `deployment.<initContainer>.volumeMounts` for the init containers and `deployment.gitea.volumeMounts` for the Gitea
places have to be listed in both settings. container. Volumes that are needed in both places have to be listed in both settings.
- `extraInitVolumeMounts` has been removed. It fanned a mount out to the four chart-managed init containers, but never
reached init containers added through `deployment.initContainers[].container`, despite its name. Configure the mount
on the init containers that actually need it: `deployment.initDirectories.volumeMounts`,
`deployment.initAppIni.volumeMounts`, `deployment.initConfigureGPG.volumeMounts` or
`deployment.initConfigureGitea.volumeMounts`.
</details> </details>
-6
View File
@@ -475,12 +475,6 @@ https
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- define "gitea.init-additional-mounts" -}}
{{- if gt (len .Values.extraInitVolumeMounts) 0 -}}
{{- toYaml .Values.extraInitVolumeMounts -}}
{{- end -}}
{{- end -}}
{{- define "gitea.container-additional-mounts" -}} {{- define "gitea.container-additional-mounts" -}}
{{- if gt (len .Values.deployment.gitea.volumeMounts) 0 -}} {{- if gt (len .Values.deployment.gitea.volumeMounts) 0 -}}
{{- toYaml .Values.deployment.gitea.volumeMounts -}} {{- toYaml .Values.deployment.gitea.volumeMounts -}}
-4
View File
@@ -43,7 +43,6 @@
{{- if .Values.persistence.new.subPath }} {{- if .Values.persistence.new.subPath }}
subPath: {{ .Values.persistence.new.subPath }} subPath: {{ .Values.persistence.new.subPath }}
{{- end }} {{- end }}
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
{{- with $config.volumeMounts }} {{- with $config.volumeMounts }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
@@ -114,7 +113,6 @@
- name: additional-config-sources-{{ $idx }} - name: additional-config-sources-{{ $idx }}
mountPath: "/env-to-ini-mounts/additionals/{{ $idx }}/" mountPath: "/env-to-ini-mounts/additionals/{{ $idx }}/"
{{- end }} {{- end }}
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
{{- with $config.volumeMounts }} {{- with $config.volumeMounts }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
@@ -174,7 +172,6 @@
- name: gpg-private-key - name: gpg-private-key
mountPath: /raw mountPath: /raw
readOnly: true readOnly: true
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
{{- with $config.volumeMounts }} {{- with $config.volumeMounts }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
@@ -293,7 +290,6 @@
{{- if .Values.persistence.new.subPath }} {{- if .Values.persistence.new.subPath }}
subPath: {{ .Values.persistence.new.subPath }} subPath: {{ .Values.persistence.new.subPath }}
{{- end }} {{- end }}
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
{{- with $config.volumeMounts }} {{- with $config.volumeMounts }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
+6 -1
View File
@@ -65,9 +65,14 @@
{{- fail "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." -}} {{- fail "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." -}}
{{- end -}} {{- end -}}
{{/* EXTRA INIT VOLUME MOUNTS */}}
{{- if .Values.extraInitVolumeMounts -}}
{{- fail "`extraInitVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.<initContainer>.volumeMounts` instead." -}}
{{- end -}}
{{/* EXTRA VOLUME MOUNTS */}} {{/* EXTRA VOLUME MOUNTS */}}
{{- if .Values.extraVolumeMounts -}} {{- if .Values.extraVolumeMounts -}}
{{- fail "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `extraInitVolumeMounts` instead." -}} {{- fail "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `deployment.<initContainer>.volumeMounts` instead." -}}
{{- end -}} {{- end -}}
{{/* EXTRA VOLUMES */}} {{/* EXTRA VOLUMES */}}
+12 -1
View File
@@ -54,6 +54,14 @@ tests:
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." errorMessage: "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead."
- it: fails when the removed `extraInitVolumeMounts` value is set
set:
extraInitVolumeMounts:
- name: postgres-ssl-vol
mountPath: /pg-ssl
asserts:
- failedTemplate:
errorMessage: "`extraInitVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.<initContainer>.volumeMounts` instead."
- it: fails when the removed `extraVolumeMounts` value is set - it: fails when the removed `extraVolumeMounts` value is set
set: set:
extraVolumeMounts: extraVolumeMounts:
@@ -61,7 +69,7 @@ tests:
mountPath: /pg-ssl mountPath: /pg-ssl
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `extraInitVolumeMounts` instead." errorMessage: "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `deployment.<initContainer>.volumeMounts` instead."
- it: fails when the removed `extraVolumes` value is set - it: fails when the removed `extraVolumes` value is set
set: set:
extraVolumes: extraVolumes:
@@ -193,6 +201,9 @@ tests:
extraContainerVolumeMounts: extraContainerVolumeMounts:
- name: postgres-ssl-vol - name: postgres-ssl-vol
mountPath: /pg-ssl mountPath: /pg-ssl
extraInitVolumeMounts:
- name: postgres-ssl-vol
mountPath: /pg-ssl
extraVolumeMounts: extraVolumeMounts:
- name: postgres-ssl-vol - name: postgres-ssl-vol
mountPath: /pg-ssl mountPath: /pg-ssl
-6
View File
@@ -924,12 +924,6 @@ extraContainers: []
# image: busybox # image: busybox
# command: [/bin/sh, -c, 'echo "Hello world"'] # command: [/bin/sh, -c, 'echo "Hello world"']
## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration.
extraInitVolumeMounts: []
# - name: postgres-ssl-vol
# readOnly: true
# mountPath: "/pg-ssl"
## @section Init ## @section Init
## @param initPreScript Bash shell script copied verbatim to the start of the init-container. ## @param initPreScript Bash shell script copied verbatim to the start of the init-container.
initPreScript: "" initPreScript: ""