refactor(templates): rename template files to match rendered resource kinds
changelog / changelog (push) Successful in 19s
check-and-test / check-and-test (push) Successful in 2m59s

The files in templates/gitea/ used a mix of naming styles: lowercase concatenations
(poddisruptionbudget.yaml, serviceaccount.yaml, servicemonitor.yaml, pvc.yaml), camelCase
(httpService.yaml, sshService.yaml) and kind-suffixed names (gpg-secret.yaml, metrics-secret.yaml).
It was therefore not obvious from a file name which Kubernetes resource it renders, and the naming
contradicted the camelCase convention the Gateway API templates already follow.

Files are now named after the kind they render, with a lowercase suffix distinguishing several
resources of the same kind:

  config.yaml              -> secret_config.yaml + secret_inlineConfig.yaml
  gpg-secret.yaml          -> secret_gpg.yaml
  init.yaml                -> secret_init.yaml
  metrics-secret.yaml      -> secret_metrics.yaml
  httpService.yaml         -> service_http.yaml
  sshService.yaml          -> service_ssh.yaml
  poddisruptionbudget.yaml -> podDisruptionBudget.yaml
  pvc.yaml                 -> persistentVolumeClaim.yaml
  serviceaccount.yaml      -> serviceAccount.yaml
  servicemonitor.yaml      -> serviceMonitor.yaml

config.yaml rendered two Secrets from a single file, which forced every unit test to address them via
documentIndex. It is split so that each file renders exactly one resource.

The rendered manifests are unchanged; only file names and the references to them were touched. This
includes the checksum/config annotation in deployment.yaml and all helm unit test suites. The HA guard
assertions had to move from deployment.yaml to secret_config.yaml: Helm sorts templates in reverse
alphabetical order, so secret_config.yaml is now rendered before deployment.yaml and the fail() is
reported for that file directly instead of bubbling up through the include chain of the Deployment.

Users relying on the template paths (e.g. `helm template --show-only` or post-renderers) have to
adjust to the new file names.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-09-03 14:20:12 +02:00
co-authored by Copilot
parent bebe2a6009
commit 4884dc0fe0
50 changed files with 96 additions and 95 deletions
+3 -3
View File
@@ -3,17 +3,17 @@ release:
name: gitea-unittests
namespace: testing
templates:
- templates/gitea/config.yaml
- templates/gitea/secret_inlineConfig.yaml
tests:
- it: "actions are enabled by default (based on vanilla Gitea behavior)"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
notExists:
path: stringData.actions
- it: "actions can be disabled via inline config"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
gitea.config.actions.ENABLED: false
asserts:
+3 -3
View File
@@ -4,7 +4,7 @@ release:
namespace: testing
tests:
- it: "cache is configured correctly for valkey"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: true
@@ -17,7 +17,7 @@ tests:
HOST=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
- it: "cache is configured correctly for 'memory' when valkey is disabled"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: false
@@ -30,7 +30,7 @@ tests:
HOST=
- it: "cache can be customized when valkey is disabled"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: false
@@ -3,12 +3,12 @@ release:
name: gitea-unittests
namespace: testing
templates:
- templates/gitea/config.yaml
- templates/gitea/secret_config.yaml
tests:
- it: uses `gitea config edit-ini` to write app.ini from environment variables
template: templates/gitea/config.yaml
template: templates/gitea/secret_config.yaml
asserts:
- documentIndex: 1
- documentIndex: 0
matchRegex:
path: stringData["config_environment.sh"]
pattern: 'gitea config edit-ini --apply-env --config .+GITEA_APP_INI.+ --out .+GITEA_APP_INI'
@@ -4,7 +4,7 @@ release:
namespace: testing
tests:
- it: metrics token is set
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
gitea:
metrics:
@@ -18,7 +18,7 @@ tests:
ENABLED=true
TOKEN=somepassword
- it: metrics token is empty
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
gitea:
metrics:
@@ -31,7 +31,7 @@ tests:
value: |-
ENABLED=true
- it: metrics token is nil
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
gitea:
metrics:
@@ -44,7 +44,7 @@ tests:
value: |-
ENABLED=true
- it: does not configures a token if metrics are disabled
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
gitea:
metrics:
+3 -3
View File
@@ -4,7 +4,7 @@ release:
namespace: testing
tests:
- it: "queue is configured correctly for valkey"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: true
@@ -17,7 +17,7 @@ tests:
TYPE=redis
- it: "queue is configured correctly for 'levelDB' when valkey is disabled"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: false
@@ -30,7 +30,7 @@ tests:
TYPE=level
- it: "queue can be customized when valkey is disabled"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: false
@@ -4,7 +4,7 @@ release:
namespace: testing
tests:
- it: "[default values] uses ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
matchRegex:
@@ -22,7 +22,7 @@ tests:
################################################
- it: "[no ingress hosts] uses gitea http service for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
ingress:
hosts: []
@@ -43,7 +43,7 @@ tests:
################################################
- it: "[provided via values] uses that for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
gitea.config.server.DOMAIN: provided.example.com
ingress:
@@ -69,7 +69,7 @@ tests:
################################################
- it: "[route enabled] uses route host for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
route:
enabled: true
@@ -91,7 +91,7 @@ tests:
################################################
- it: "[route tls termination] uses https for ROOT_URL"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
route:
enabled: true
@@ -107,7 +107,7 @@ tests:
################################################
- it: "[HTTPRoute enabled] uses first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
ingress:
hosts: []
@@ -137,7 +137,7 @@ tests:
################################################
- it: "[HTTPRoute tls] switches ROOT_URL to https"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
ingress:
hosts: []
+3 -3
View File
@@ -4,7 +4,7 @@ release:
namespace: testing
tests:
- it: "session is configured correctly for valkey"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: true
@@ -17,7 +17,7 @@ tests:
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
- it: "session is configured correctly for 'memory' when valkey is disabled"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: false
@@ -30,7 +30,7 @@ tests:
PROVIDER_CONFIG=
- it: "session can be customized when valkey is disabled"
template: templates/gitea/config.yaml
template: templates/gitea/secret_inlineConfig.yaml
set:
valkey:
enabled: false