Files
helm-gitea/unittests/helm/deployment/checksum-annotations.yaml
T
volker.raschekandCopilot 552fe8c56e
Helm / helm-lint (push) Successful in 9s
changelog / changelog (push) Successful in 29s
Helm / helm-unittest (push) Failing after 21s
Markdown linter / markdown-lint (push) Successful in 17s
Markdown linter / markdown-link-checker (push) Successful in 56s
refactor(templates): move the templates out of the gitea subdirectory
The `templates/gitea` subdirectory did not group anything meaningful, since every template of this chart belongs to
Gitea. It only duplicated the chart name in every path and forced the unit tests to spell out
`templates/gitea/<name>.yaml`, while `_helpers.tpl` and `NOTES.txt` already lived directly in `templates`.

All templates now live in `templates`, which matches the layout of the bundled sub-charts and the Helm defaults.

The checksum helper in `templates/_secrets.tpl` built its include path from `$root.Template.BasePath` and therefore
carried the subdirectory in a `printf` format string instead of a literal path. Without adjusting it the chart failed to
render with "no template gitea/templates/gitea/secret_config.yaml associated with template gotpl".

Co-authored-by: Copilot <copilot@github.com>
2026-09-14 20:28:17 +02:00

159 lines
5.6 KiB
YAML

suite: deployment template (checksum annotations)
release:
name: gitea-unittests
namespace: testing
templates:
- templates/deployment.yaml
- templates/secret_admin.yaml
- templates/secret_config.yaml
- templates/secret_gpg.yaml
- templates/secret_init.yaml
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: omits the checksum annotations by default
template: templates/deployment.yaml
set:
secrets.admin.enabled: true
secrets.config.enabled: true
secrets.gpg.enabled: true
secrets.gpg.new.privateKey: |
-----BEGIN PGP PRIVATE KEY BLOCK-----
-----END PGP PRIVATE KEY BLOCK-----
secrets.init.enabled: true
secrets.inlineConfig.enabled: true
secrets.metrics.enabled: true
asserts:
- notExists:
path: spec.template.metadata.annotations["checksum/admin"]
- notExists:
path: spec.template.metadata.annotations["checksum/config"]
- notExists:
path: spec.template.metadata.annotations["checksum/gpg"]
- notExists:
path: spec.template.metadata.annotations["checksum/init"]
- notExists:
path: spec.template.metadata.annotations["checksum/inlineConfig"]
- notExists:
path: spec.template.metadata.annotations["checksum/metrics"]
- it: adds a checksum annotation for every Secret when addSHASumAnnotation is enabled
template: templates/deployment.yaml
set:
secrets.admin.addSHASumAnnotation: true
secrets.admin.enabled: true
secrets.config.addSHASumAnnotation: true
secrets.config.enabled: true
secrets.gpg.addSHASumAnnotation: true
secrets.gpg.enabled: true
secrets.gpg.new.privateKey: |
-----BEGIN PGP PRIVATE KEY BLOCK-----
-----END PGP PRIVATE KEY BLOCK-----
secrets.init.addSHASumAnnotation: true
secrets.init.enabled: true
secrets.inlineConfig.addSHASumAnnotation: true
secrets.inlineConfig.enabled: true
secrets.metrics.addSHASumAnnotation: true
secrets.metrics.enabled: true
asserts:
- exists:
path: spec.template.metadata.annotations["checksum/admin"]
- exists:
path: spec.template.metadata.annotations["checksum/config"]
- exists:
path: spec.template.metadata.annotations["checksum/gpg"]
- exists:
path: spec.template.metadata.annotations["checksum/init"]
- exists:
path: spec.template.metadata.annotations["checksum/inlineConfig"]
- exists:
path: spec.template.metadata.annotations["checksum/metrics"]
- it: omits the checksum annotation of a single disabled Secret only
template: templates/deployment.yaml
set:
secrets.admin.addSHASumAnnotation: false
secrets.admin.enabled: true
secrets.config.addSHASumAnnotation: false
secrets.config.enabled: true
secrets.gpg.addSHASumAnnotation: false
secrets.gpg.enabled: true
secrets.gpg.new.privateKey: |
-----BEGIN PGP PRIVATE KEY BLOCK-----
-----END PGP PRIVATE KEY BLOCK-----
secrets.init.addSHASumAnnotation: false
secrets.init.enabled: true
secrets.inlineConfig.addSHASumAnnotation: false
secrets.inlineConfig.enabled: true
secrets.metrics.addSHASumAnnotation: false
secrets.metrics.enabled: true
asserts:
- notExists:
path: spec.template.metadata.annotations["checksum/admin"]
- notExists:
path: spec.template.metadata.annotations["checksum/config"]
- notExists:
path: spec.template.metadata.annotations["checksum/gpg"]
- notExists:
path: spec.template.metadata.annotations["checksum/init"]
- notExists:
path: spec.template.metadata.annotations["checksum/inlineConfig"]
- notExists:
path: spec.template.metadata.annotations["checksum/metrics"]
- it: adds the checksum of Secrets provided by the user
template: templates/deployment.yaml
set:
secrets.admin.enabled: true
secrets.admin.addSHASumAnnotation: true
secrets.admin.existingSecret.enabled: true
secrets.admin.existingSecret.secretName: custom-admin
secrets.config.enabled: true
secrets.config.addSHASumAnnotation: true
secrets.config.existingSecret.enabled: true
secrets.config.existingSecret.secretName: custom-config
secrets.gpg.enabled: true
secrets.gpg.addSHASumAnnotation: true
secrets.gpg.existingSecret.enabled: true
secrets.gpg.existingSecret.secretName: custom-gpg
secrets.init.enabled: true
secrets.init.addSHASumAnnotation: true
secrets.init.existingSecret.enabled: true
secrets.init.existingSecret.secretName: custom-init
secrets.inlineConfig.enabled: true
secrets.inlineConfig.addSHASumAnnotation: true
secrets.inlineConfig.existingSecret.enabled: true
secrets.inlineConfig.existingSecret.secretName: custom-inline-config
secrets.metrics.enabled: true
secrets.metrics.addSHASumAnnotation: true
secrets.metrics.existingSecret.enabled: true
secrets.metrics.existingSecret.secretName: custom-metrics
asserts:
- exists:
path: spec.template.metadata.annotations["checksum/admin"]
- exists:
path: spec.template.metadata.annotations["checksum/config"]
- exists:
path: spec.template.metadata.annotations["checksum/gpg"]
- exists:
path: spec.template.metadata.annotations["checksum/init"]
- exists:
path: spec.template.metadata.annotations["checksum/inlineConfig"]
- exists:
path: spec.template.metadata.annotations["checksum/metrics"]