Skip to content

Commit 7a5187f

Browse files
committed
Adds KUTTL_PG_UPGRADE_TO_VERSION parameter
A new parameter is added to decouple settings between operator tests and upgrade tests. Issue: [sc-17416]
1 parent a1397fd commit 7a5187f

12 files changed

+15
-14
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ check-kuttl:
221221

222222
.PHONY: generate-kuttl
223223
generate-kuttl: export KUTTL_PG_UPGRADE_FROM_VERSION ?= 13
224+
generate-kuttl: export KUTTL_PG_UPGRADE_TO_VERSION ?= 14
224225
generate-kuttl: export KUTTL_PG_VERSION ?= 14
225226
generate-kuttl: export KUTTL_POSTGIS_VERSION ?= 3.1
226227
generate-kuttl: export KUTTL_PSQL_IMAGE ?= registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-14.6-2
@@ -235,7 +236,7 @@ generate-kuttl:
235236
12 ) export KUTTL_BITNAMI_IMAGE_TAG=12.12.0-debian-11-r40 ;; \
236237
11 ) export KUTTL_BITNAMI_IMAGE_TAG=11.17.0-debian-11-r39 ;; \
237238
esac; \
238-
render() { envsubst '"'"'$$KUTTL_PG_UPGRADE_FROM_VERSION $$KUTTL_PG_VERSION $$KUTTL_POSTGIS_VERSION $$KUTTL_PSQL_IMAGE $$KUTTL_BITNAMI_IMAGE_TAG'"'"'; }; \
239+
render() { envsubst '"'"'$$KUTTL_PG_UPGRADE_FROM_VERSION $$KUTTL_PG_UPGRADE_TO_VERSION $$KUTTL_PG_VERSION $$KUTTL_POSTGIS_VERSION $$KUTTL_PSQL_IMAGE $$KUTTL_BITNAMI_IMAGE_TAG'"'"'; }; \
239240
while [ $$# -gt 0 ]; do \
240241
source="$${1}" target="$${1/e2e/e2e-generated}"; \
241242
mkdir -p "$${target%/*}"; render < "$${source}" > "$${target}"; \

testing/kuttl/e2e/major-upgrade/02--valid-upgrade.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ metadata:
66
name: major-upgrade-do-it
77
spec:
88
fromPostgresVersion: ${KUTTL_PG_UPGRADE_FROM_VERSION}
9-
toPostgresVersion: ${KUTTL_PG_VERSION}
9+
toPostgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION}
1010
postgresClusterName: major-upgrade

testing/kuttl/e2e/major-upgrade/10--already-updated-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ kind: PostgresCluster
55
metadata:
66
name: major-upgrade
77
spec:
8-
postgresVersion: ${KUTTL_PG_VERSION}
8+
postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION}
99
instances:
1010
- dataVolumeClaimSpec: { accessModes: [ReadWriteOnce], resources: { requests: { storage: 1Gi } } }
1111
backups:

testing/kuttl/e2e/major-upgrade/33-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ kind: PostgresCluster
1919
metadata:
2020
name: major-upgrade
2121
status:
22-
postgresVersion: ${KUTTL_PG_VERSION}
22+
postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION}

testing/kuttl/e2e/major-upgrade/34--restart-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ kind: PostgresCluster
66
metadata:
77
name: major-upgrade
88
spec:
9-
postgresVersion: ${KUTTL_PG_VERSION}
9+
postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION}
1010
shutdown: false

testing/kuttl/e2e/major-upgrade/34-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ kind: PostgresCluster
55
metadata:
66
name: major-upgrade
77
status:
8-
postgresVersion: ${KUTTL_PG_VERSION}
8+
postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION}
99
instances:
1010
- name: '00'
1111
replicas: 3

testing/kuttl/e2e/major-upgrade/36--check-data-and-version.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
- |
3535
DO $$$$
3636
BEGIN
37-
ASSERT current_setting('server_version_num') LIKE '${KUTTL_PG_VERSION}%',
37+
ASSERT current_setting('server_version_num') LIKE '${KUTTL_PG_UPGRADE_TO_VERSION}%',
3838
format('got %L', current_setting('server_version_num'));
3939
END $$$$;
4040
- --command
@@ -94,7 +94,7 @@ spec:
9494
- |
9595
DO $$$$
9696
BEGIN
97-
ASSERT current_setting('server_version_num') LIKE '${KUTTL_PG_VERSION}%',
97+
ASSERT current_setting('server_version_num') LIKE '${KUTTL_PG_UPGRADE_TO_VERSION}%',
9898
format('got %L', current_setting('server_version_num'));
9999
END $$$$;
100100
- --command

testing/kuttl/e2e/wal-pvc-pgupgrade/00--create-resources.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ metadata:
2424
name: wal-pvc-pgupgrade-do-it
2525
spec:
2626
fromPostgresVersion: ${KUTTL_PG_UPGRADE_FROM_VERSION}
27-
toPostgresVersion: ${KUTTL_PG_VERSION}
27+
toPostgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION}
2828
postgresClusterName: wal-pvc-pgupgrade

testing/kuttl/e2e/wal-pvc-pgupgrade/03-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ kind: PostgresCluster
1919
metadata:
2020
name: wal-pvc-pgupgrade
2121
status:
22-
postgresVersion: ${KUTTL_PG_VERSION}
22+
postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION}

testing/kuttl/e2e/wal-pvc-pgupgrade/04--restart-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ kind: PostgresCluster
66
metadata:
77
name: wal-pvc-pgupgrade
88
spec:
9-
postgresVersion: ${KUTTL_PG_VERSION}
9+
postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION}
1010
shutdown: false

0 commit comments

Comments
 (0)