test: add unit tests for custom clusterDomain in database connection strings
Verify that PostgreSQL and PostgreSQL-HA service hostnames correctly use a custom `clusterDomain` value instead of the default `cluster.local` when connecting to the database.
This commit is contained in:
@@ -112,6 +112,15 @@ tests:
|
|||||||
matchRegex:
|
matchRegex:
|
||||||
path: stringData.database
|
path: stringData.database
|
||||||
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.cluster.local:1234
|
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.cluster.local:1234
|
||||||
|
- it: "[gitea] connects to pgpool service with custom cluster domain"
|
||||||
|
set:
|
||||||
|
clusterDomain: my-special-cluster.local
|
||||||
|
template: templates/gitea/config.yaml
|
||||||
|
asserts:
|
||||||
|
- documentIndex: 0
|
||||||
|
matchRegex:
|
||||||
|
path: stringData.database
|
||||||
|
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.my-special-cluster.local:1234
|
||||||
- it: "[gitea] connects to configured database"
|
- it: "[gitea] connects to configured database"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/config.yaml
|
||||||
asserts:
|
asserts:
|
||||||
|
|||||||
@@ -71,6 +71,15 @@ tests:
|
|||||||
matchRegex:
|
matchRegex:
|
||||||
path: stringData.database
|
path: stringData.database
|
||||||
pattern: HOST=gitea-unittests-postgresql.testing.svc.cluster.local:1234
|
pattern: HOST=gitea-unittests-postgresql.testing.svc.cluster.local:1234
|
||||||
|
- it: "[gitea] connects to postgresql service with custom cluster domain"
|
||||||
|
set:
|
||||||
|
clusterDomain: my-special-cluster.local
|
||||||
|
template: templates/gitea/config.yaml
|
||||||
|
asserts:
|
||||||
|
- documentIndex: 0
|
||||||
|
matchRegex:
|
||||||
|
path: stringData.database
|
||||||
|
pattern: HOST=gitea-unittests-postgresql.testing.svc.my-special-cluster.local:1234
|
||||||
- it: "[gitea] connects to configured database"
|
- it: "[gitea] connects to configured database"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/config.yaml
|
||||||
asserts:
|
asserts:
|
||||||
|
|||||||
Reference in New Issue
Block a user