Files
helm-gitea/unittests/helm/config/session-config.yaml
T
perfectra1nandperfectra1n 4631d42156 [Close #1119] fix(secrets): render inline config as data to prune removed sections
The inline-config Secret used `stringData`. The API server stores it as `data`, so a section removed from `gitea.config` was never pruned from the live Secret, and the init container kept writing it into `app.ini` on every start. With Gitea 28, a leftover `[webhook] ALLOWED_HOST_LIST` overrides `[security]`'s, which breaks webhooks to private hosts.

This renders the Secret as base64 `data` instead.

- `templates/secret_inlineConfig.yaml`: `stringData` → `data` (`b64enc`).
- Unit tests read `data.*` with `decodeBase64: true`; adds a regression test asserting there is no `stringData`.

Note: keys that are already stale from the `stringData` era survive the first upgrade to this version, because Helm's three-way merge never recorded them under `data`. Every removal after that is pruned.

`make unittests-helm`: 261 passed. `helm lint` and `yamllint` are clean.
Co-authored-by: perfectra1n <jonfuller2012@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-gitea/pulls/1110
Co-authored-by: perfectra1n <49838+perfectra1n@noreply.gitea.com>
2026-10-03 15:16:25 +00:00

49 lines
1.4 KiB
YAML

suite: config template | session config
release:
name: gitea-unittests
namespace: testing
tests:
- it: "session is configured correctly for valkey"
template: templates/secret_inlineConfig.yaml
set:
valkey:
enabled: true
asserts:
- documentIndex: 0
equal:
path: data.session
decodeBase64: true
value: |-
PROVIDER=redis
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/secret_inlineConfig.yaml
set:
valkey:
enabled: false
asserts:
- documentIndex: 0
equal:
path: data.session
decodeBase64: true
value: |-
PROVIDER=memory
PROVIDER_CONFIG=
- it: "session can be customized when valkey is disabled"
template: templates/secret_inlineConfig.yaml
set:
valkey:
enabled: false
gitea.config.session.PROVIDER: custom-provider
gitea.config.session.PROVIDER_CONFIG: custom-provider-config
asserts:
- documentIndex: 0
equal:
path: data.session
decodeBase64: true
value: |-
PROVIDER=custom-provider
PROVIDER_CONFIG=custom-provider-config