The names of the Secrets rendered by the chart were built inline in each template and, for two of them, in ad-hoc chart-wide helpers. The same name therefore existed in several places (Deployment volumes, ServiceMonitor credentials, the Secret templates themselves), which made every rename a multi-file change and allowed the references to drift apart unnoticed - the Helm unit tests render one template at a time and cannot detect a mismatching secretName. All Secret names are now defined once in templates/gitea/_secrets.tpl: gitea.secret.config.name -> <fullname>-config gitea.secret.gpg.name -> <fullname>-gpg-key (or signing.existingSecret) gitea.secret.init.name -> <fullname>-init gitea.secret.inlineConfig.name -> <fullname>-inline-config gitea.secret.metrics.name -> <fullname>-metrics gitea.gpg-key-secret-name and gitea.metrics-secret-name are removed from _helpers.tpl accordingly. A checksum/inlineConfig pod annotation is added as well. After the inline configuration had been split out of secret_config.yaml, changes to it were no longer covered by any checksum annotation and did not trigger a rollout of the Deployment. Finally the metadata attributes of the Secret templates are sorted alphabetically as required by the chart conventions. BREAKING CHANGE: two Secrets are renamed. The config Secret changes from <fullname> to <fullname>-config and the metrics Secret from <fullname>-metrics-secret to <fullname>-metrics. Helm replaces both on upgrade; references to them from outside the chart have to be adjusted. Co-authored-by: Copilot <copilot@github.com>
61 lines
2.1 KiB
YAML
61 lines
2.1 KiB
YAML
suite: deployment template (HA)
|
|
release:
|
|
name: gitea-unittests
|
|
namespace: testing
|
|
templates:
|
|
- templates/gitea/deployment.yaml
|
|
- templates/gitea/secret_config.yaml
|
|
- templates/gitea/secret_inlineConfig.yaml
|
|
tests:
|
|
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled
|
|
template: templates/gitea/secret_config.yaml
|
|
set:
|
|
replicaCount: 2
|
|
persistence:
|
|
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:
|
|
replicaCount: 2
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.accessModes[0] must be set to ReadWriteMany."
|
|
- it: fails with multiple replicas and bleve issue indexer
|
|
template: templates/gitea/secret_config.yaml
|
|
set:
|
|
replicaCount: 2
|
|
persistence:
|
|
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:
|
|
replicaCount: 2
|
|
persistence:
|
|
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."
|