refactor(persistence)!: group the values into existingPersistentVolumeClaim and new
Helm / helm-lint (push) Successful in 13s
changelog / changelog (push) Successful in 22s
Helm / helm-unittest (push) Failing after 45s
Markdown linter / markdown-link-checker (push) Successful in 44s
Markdown linter / markdown-lint (push) Successful in 36s

The flat `persistence` dict mixed three concerns: whether persistence is used at all, whether the chart creates the
PersistentVolumeClaim, and how that claim is shaped. The pairs `create`/`claimName` and `enabled`/`mount` were only
meaningful in certain combinations, so an invalid configuration such as `create=true` together with a foreign
`claimName` was silently accepted. The same split into an `existingX`/`new` pair is already used for the Secrets, so
this aligns persistence with the rest of the chart.

`persistence.enabled` now only decides whether a volume is used at all. `persistence.existingPersistentVolumeClaim`
points at a claim managed outside of the chart, and everything under `persistence.new` describes the claim the chart
creates itself. Rendering and naming move into `templates/gitea/_persistentVolumeClaims.tpl` so the Deployment and the
PersistentVolumeClaim derive the claim name from a single helper instead of repeating the value lookups.

Support for `global.storageClass` is dropped. It was a chart-wide override that silently applied to the Gitea claim and
was evaluated through `tpl`, which made the effective storage class hard to predict. The storage class is now set
explicitly via `persistence.new.storageClassName`, which also matches the field name in the PersistentVolumeClaim spec.

BREAKING CHANGE: The `persistence` values were restructured and `global.storageClass` was removed.

- `persistence.create` and `persistence.mount` are gone. Set `persistence.enabled` to use a volume and
  `persistence.existingPersistentVolumeClaim.enabled` to reuse a claim that is not managed by the chart.
- `persistence.claimName` moves to `persistence.existingPersistentVolumeClaim.persistentVolumeClaimName`. A claim
  created by the chart is now named after `gitea.fullname` instead of the default `gitea-shared-storage`.
- `persistence.accessModes`, `annotations`, `labels`, `size` and `subPath` move into `persistence.new`.
- `persistence.volumeName` becomes `persistence.new.persistentVolumeName`.
- `persistence.storageClass` and `global.storageClass` become `persistence.new.storageClassName`.
- `persistence.enabled` now defaults to `false`.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-09-14 15:38:06 +02:00
co-authored by Copilot
parent 761921faed
commit dfe087c0c1
12 changed files with 160 additions and 139 deletions
+26 -26
View File
@@ -5,7 +5,6 @@
#
## @param global.imageRegistry global image registry override.
## @param global.imagePullSecrets global image pull secrets override; can be extended by `imagePullSecrets`.
## @param global.storageClass global storage class override.
## @param global.hostAliases global hostAliases which will be added to the pod's hosts files.
global:
imageRegistry: ""
@@ -14,7 +13,6 @@ global:
## - myRegistryKeySecretName
##
imagePullSecrets: []
storageClass: ""
hostAliases: []
# - ip: 192.168.137.2
# hostnames:
@@ -887,31 +885,33 @@ serviceAccount:
labels: {}
## @section Persistence
## @param persistence.enabled Enable persistent storage.
## @param persistence.create Whether to create the persistentVolumeClaim for shared storage.
## @param persistence.mount Whether the persistentVolumeClaim should be mounted (even if not created).
## @param persistence.claimName Use an existing claim to store repository information.
## @param persistence.size Size for persistence to store repo information.
## @param persistence.accessModes AccessMode for persistence.
## @param persistence.labels Labels for the persistence volume claim to be created.
## @param persistence.annotations.helm.sh/resource-policy Resource policy for the persistence volume claim.
## @param persistence.storageClass Name of the storage class to use.
## @param persistence.subPath Subdirectory of the volume to mount at.
## @param persistence.volumeName Name of persistent volume in PVC.
persistence:
enabled: true
create: true
mount: true
claimName: gitea-shared-storage
size: 10Gi
accessModes:
- ReadWriteOnce
labels: {}
storageClass:
subPath:
volumeName: ""
annotations:
helm.sh/resource-policy: keep
## @param persistence.enabled Enable persistent storage.
enabled: false
## @param persistence.existingPersistentVolumeClaim.enabled Enable using an existing persistent volume claim.
## @param persistence.existingPersistentVolumeClaim.persistentVolumeClaimName Name of the existing persistent volume claim to use.
existingPersistentVolumeClaim:
enabled: false
persistentVolumeClaimName: ""
## @param persistence.new.annotations.helm.sh/resource-policy Resource policy for the new persistent volume claim.
## @param persistence.new.labels Labels for the new persistent volume claim.
## @param persistence.new.accessModes AccessMode for the new persistent volume claim.
## @param persistence.new.persistentVolumeName Name of the persistent volume for the new persistent volume claim.
## @param persistence.new.size Size for the new persistent volume claim.
## @param persistence.new.storageClassName Name of the storage class to use for the new persistent volume claim.
## @param persistence.new.subPath Subdirectory of the volume to mount at for the new persistent volume claim.
new:
annotations:
helm.sh/resource-policy: keep
labels: {}
accessModes:
- ReadWriteOnce
persistentVolumeName: ""
size: 10Gi
storageClassName: ""
subPath: ""
## @param extraContainers Additional sidecar containers to run in the pod.
extraContainers: []