suite: Dependency checks | Customization integrity | postgresql-ha release: name: gitea-unittests namespace: testing set: postgresql: enabled: false postgresql-ha: enabled: true global: postgresql: database: gitea-database password: gitea-password username: gitea-username postgresql: repmgrPassword: custom-password-repmgr postgresPassword: custom-password-postgres password: custom-password-overwritten-by-global-postgresql-password pgpool: adminPassword: custom-password-pgpool srCheckPassword: custom-password-sr-check service: ports: postgresql: 1234 persistence: size: 1337Mi tests: - it: "[postgresql-ha] Apply the database settings" template: charts/postgresql-ha/templates/postgresql/statefulset.yaml asserts: - documentIndex: 0 contains: path: spec.template.spec.containers[0].env content: name: POSTGRES_DB value: "gitea-database" - documentIndex: 0 contains: path: spec.template.spec.containers[0].env content: name: POSTGRES_USER value: "gitea-username" - it: "[postgresql-ha] Apply the database passwords" template: charts/postgresql-ha/templates/postgresql/secrets.yaml asserts: - documentIndex: 0 equal: path: data["repmgr-password"] value: "Y3VzdG9tLXBhc3N3b3JkLXJlcG1ncg==" - documentIndex: 0 equal: path: data["postgres-password"] value: "Y3VzdG9tLXBhc3N3b3JkLXBvc3RncmVz" - documentIndex: 0 equal: path: data["password"] value: "Z2l0ZWEtcGFzc3dvcmQ=" # postgresql-ha.postgresql.password is overwritten by postgresql-ha.global.postgresql.password and should not be referenced here - it: "[postgresql-ha] Apply pgpool.adminPassword" template: charts/postgresql-ha/templates/pgpool/secrets.yaml asserts: - documentIndex: 0 equal: path: data["admin-password"] value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA==" - it: "[postgresql-ha] Apply pgpool.srCheckPassword" template: charts/postgresql-ha/templates/pgpool/secrets.yaml asserts: - documentIndex: 0 equal: path: data["sr-check-password"] value: "Y3VzdG9tLXBhc3N3b3JkLXNyLWNoZWNr" - it: "[postgresql-ha] Apply persistence.size" template: charts/postgresql-ha/templates/postgresql/statefulset.yaml asserts: - documentIndex: 0 equal: path: spec.volumeClaimTemplates[0].spec.resources.requests.storage value: "1337Mi" - it: "[postgresql-ha] Apply service.ports.postgresql" template: charts/postgresql-ha/templates/pgpool/service.yaml asserts: - documentIndex: 0 equal: path: spec.ports[0].port value: 1234 - it: "[postgresql-ha] Render the referenced Service" template: charts/postgresql-ha/templates/pgpool/service.yaml asserts: - containsDocument: kind: Service apiVersion: v1 name: gitea-unittests-postgresql-ha-pgpool namespace: testing - it: "[gitea] Connect to the pgpool Service" template: templates/secret_inlineConfig.yaml asserts: - documentIndex: 0 matchRegex: path: data.database decodeBase64: true pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.cluster.local:1234 - it: "[gitea] Connect to the pgpool Service with a custom cluster domain" set: clusterDomain: my-special-cluster.local template: templates/secret_inlineConfig.yaml asserts: - documentIndex: 0 matchRegex: path: data.database decodeBase64: true pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.my-special-cluster.local:1234 - it: "[gitea] Connect to the configured database" template: templates/secret_inlineConfig.yaml asserts: - documentIndex: 0 matchRegex: path: data.database decodeBase64: true pattern: NAME=gitea-database - documentIndex: 0 matchRegex: path: data.database decodeBase64: true pattern: USER=gitea-username - documentIndex: 0 matchRegex: path: data.database decodeBase64: true pattern: PASSWD=gitea-password