From 4f4bd4927c61edfd9cd084cd0cf410bc02468adb Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Mon, 20 Jul 2026 18:59:30 +0200 Subject: [PATCH] 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. --- .../customization-integrity-postgresql-ha.yaml | 9 +++++++++ .../customization-integrity-postgresql.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/unittests/helm/dependency-checks/customization-integrity-postgresql-ha.yaml b/unittests/helm/dependency-checks/customization-integrity-postgresql-ha.yaml index 9f3358b..405a9dc 100644 --- a/unittests/helm/dependency-checks/customization-integrity-postgresql-ha.yaml +++ b/unittests/helm/dependency-checks/customization-integrity-postgresql-ha.yaml @@ -112,6 +112,15 @@ tests: matchRegex: path: stringData.database 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" template: templates/gitea/config.yaml asserts: diff --git a/unittests/helm/dependency-checks/customization-integrity-postgresql.yaml b/unittests/helm/dependency-checks/customization-integrity-postgresql.yaml index a84ddc3..ba26bad 100644 --- a/unittests/helm/dependency-checks/customization-integrity-postgresql.yaml +++ b/unittests/helm/dependency-checks/customization-integrity-postgresql.yaml @@ -71,6 +71,15 @@ tests: matchRegex: path: stringData.database 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" template: templates/gitea/config.yaml asserts: