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>
72 lines
2.4 KiB
YAML
72 lines
2.4 KiB
YAML
suite: deployment template (HA)
|
|
release:
|
|
name: gitea-unittests
|
|
namespace: testing
|
|
templates:
|
|
- templates/gitea/deployment.yaml
|
|
- templates/gitea/secret_admin.yaml
|
|
- templates/gitea/secret_config.yaml
|
|
- templates/gitea/secret_gpg.yaml
|
|
- templates/gitea/secret_init.yaml
|
|
- templates/gitea/secret_inlineConfig.yaml
|
|
- templates/gitea/secret_metrics.yaml
|
|
tests:
|
|
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled
|
|
template: templates/gitea/secret_config.yaml
|
|
set:
|
|
deployment:
|
|
replicas: 2
|
|
persistence:
|
|
new:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
gitea:
|
|
config:
|
|
cron:
|
|
GIT_GC_REPOS:
|
|
ENABLED: true
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'gitea.config.cron.GIT_GC_REPOS.enabled = false'."
|
|
- it: fails with multiple replicas and RWX file system not set
|
|
template: templates/gitea/secret_config.yaml
|
|
set:
|
|
deployment:
|
|
replicas: 2
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.new.accessModes[0] must be set to ReadWriteMany."
|
|
- it: fails with multiple replicas and bleve issue indexer
|
|
template: templates/gitea/secret_config.yaml
|
|
set:
|
|
deployment:
|
|
replicas: 2
|
|
persistence:
|
|
new:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
gitea:
|
|
config:
|
|
indexer:
|
|
ISSUE_INDEXER_TYPE: bleve
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)."
|
|
- it: fails with multiple replicas and bleve repo indexer
|
|
template: templates/gitea/secret_config.yaml
|
|
set:
|
|
deployment:
|
|
replicas: 2
|
|
persistence:
|
|
new:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
gitea:
|
|
config:
|
|
indexer:
|
|
REPO_INDEXER_TYPE: bleve
|
|
REPO_INDEXER_ENABLED: true
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "When using multiple replicas, the repo indexer (gitea.config.indexer.REPO_INDEXER_TYPE) must be set to 'meilisearch' or 'elasticsearch' or disabled."
|