feat!: remove the postgresql sub-chart
With `cloudnativePG` in place, the bundled Bitnami `postgresql` sub-chart is the second in-chart way to run a database, and the worse one. It is a single, non-HA instance without failover, backup or managed major-version upgrades, and it ships images that Bitnami no longer distributes freely. Keeping it around means maintaining two code paths for the same job, including the mutual-exclusion assertion between both dependencies and a second set of DNS, credential and image helpers. Removing it leaves exactly two supported choices: a CloudNativePG `Cluster` rendered by this chart, or an external database configured via `gitea.config.database`. Both scale from a single instance to a HA setup - `cloudnativePG.instances=1` covers the use case the `postgresql` sub-chart served - so nothing is lost besides the duplication. BREAKING CHANGE: The `postgresql` sub-chart and all `postgresql.*` values have been removed. There is no in-place migration path: dump the database of the old `postgresql` release with `pg_dump`, remove the `postgresql` values, deploy the chart with `cloudnativePG.enabled=true` and restore the dump. Alternatively point `gitea.config.database` at an externally managed database. Setting `postgresql` now fails the release with a pointer to the changelog. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -46,14 +46,3 @@ tests:
|
||||
HOST=gitea-unittests-postgresql-rw.testing.svc.cluster.local:5432
|
||||
NAME=gitea-database
|
||||
USER=gitea-username
|
||||
|
||||
- it: "Fail when postgresql and cloudnativePG are enabled at the same time"
|
||||
template: templates/secret_config.yaml
|
||||
set:
|
||||
postgresql:
|
||||
enabled: true
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "Only one of postgresql or cloudnativePG can be enabled at the same time."
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
suite: Test dependency customization integrity of postgresql
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: false
|
||||
postgresql:
|
||||
enabled: true
|
||||
global:
|
||||
postgresql:
|
||||
auth:
|
||||
password: gitea-password
|
||||
database: gitea-database
|
||||
username: gitea-username
|
||||
service:
|
||||
ports:
|
||||
postgresql: 1234
|
||||
primary:
|
||||
persistence:
|
||||
size: 1337Mi
|
||||
tests:
|
||||
- it: "[postgresql] Apply the database settings"
|
||||
template: charts/postgresql/templates/primary/statefulset.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: POSTGRES_DATABASE
|
||||
value: "gitea-database"
|
||||
- documentIndex: 0
|
||||
contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: POSTGRES_USER
|
||||
value: "gitea-username"
|
||||
- it: "[postgresql] Apply the database password"
|
||||
template: charts/postgresql/templates/secrets.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["password"]
|
||||
value: "Z2l0ZWEtcGFzc3dvcmQ="
|
||||
- it: "[postgresql] Apply primary.persistence.size"
|
||||
template: charts/postgresql/templates/primary/statefulset.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
|
||||
value: "1337Mi"
|
||||
- it: "[postgresql] Apply global.postgresql.service.ports.postgresql"
|
||||
template: charts/postgresql/templates/primary/svc.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.ports[0].port
|
||||
value: 1234
|
||||
- it: "[postgresql] Render the referenced Service"
|
||||
template: charts/postgresql/templates/primary/svc.yaml
|
||||
asserts:
|
||||
- containsDocument:
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
name: gitea-unittests-postgresql
|
||||
namespace: testing
|
||||
- it: "[gitea] Connect to the postgresql Service"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: data.database
|
||||
decodeBase64: true
|
||||
pattern: HOST=gitea-unittests-postgresql.testing.svc.cluster.local:1234
|
||||
- it: "[gitea] Connect to the postgresql 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.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
|
||||
@@ -3,19 +3,6 @@ release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "[postgresql] Detect major image version upgrades"
|
||||
template: charts/postgresql/templates/primary/statefulset.yaml
|
||||
set:
|
||||
postgresql:
|
||||
enabled: true
|
||||
cloudnativePG:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: spec.template.spec.containers[0].image
|
||||
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
|
||||
pattern: bitnamilegacy/postgresql:17.+$
|
||||
- it: "[valkey] Detect major image version upgrades"
|
||||
template: charts/valkey/templates/deploy_valkey.yaml
|
||||
set:
|
||||
|
||||
@@ -98,6 +98,13 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`openshift.hostUsers` does no longer exist. Please refer to the changelog and configure `deployment.hostUsers` instead."
|
||||
- it: "Fail when the removed `postgresql` value is set"
|
||||
set:
|
||||
postgresql:
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`postgresql` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster."
|
||||
- it: "Fail when the removed `postgresql-ha` value is set"
|
||||
set:
|
||||
postgresql-ha:
|
||||
|
||||
Reference in New Issue
Block a user