Skip to content

Commit 46a613d

Browse files
committed
Add ability to easily choose the PostgresCluster API version in the kuttl/chainsaw tests
1 parent 85062e8 commit 46a613d

File tree

134 files changed

+146
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+146
-139
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ check-kuttl: ## example command: make check-kuttl KUTTL_TEST='
201201
--config testing/kuttl/kuttl-test.yaml
202202

203203
.PHONY: generate-kuttl
204+
generate-kuttl: export KUTTL_PGCLUSTER_API_VERSION ?= v1
204205
generate-kuttl: export KUTTL_PG_UPGRADE_FROM_VERSION ?= 16
205206
generate-kuttl: export KUTTL_PG_UPGRADE_TO_VERSION ?= 17
206207
generate-kuttl: export KUTTL_PG_VERSION ?= 16
@@ -211,6 +212,7 @@ generate-kuttl: ## Generate kuttl tests
211212
[ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated
212213
bash -ceu ' \
213214
render() { envsubst '"'"' \
215+
$$KUTTL_PGCLUSTER_API_VERSION \
214216
$$KUTTL_PG_UPGRADE_FROM_VERSION $$KUTTL_PG_UPGRADE_TO_VERSION \
215217
$$KUTTL_PG_VERSION $$KUTTL_POSTGIS_VERSION $$KUTTL_PSQL_IMAGE \
216218
$$KUTTL_TEST_DELETE_NAMESPACE'"'"'; }; \

testing/chainsaw/e2e/pgbackrest-restore/chainsaw-test.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ spec:
1919
- name: volume
2020
value: { accessModes: [ReadWriteOnce], resources: { requests: { storage: 1Gi } } }
2121

22+
- name: postgrescluster
23+
value:
24+
apiVersion: (join('', ['postgres-operator.crunchydata.com/', $values.versions.postgrescluster]))
25+
2226
steps:
2327
- name: 'Create Cluster with replica, tablespace'
2428
use:
@@ -85,7 +89,7 @@ spec:
8589
deletionPropagationPolicy: Background
8690
expect: [{ check: { (`true`): true } }]
8791
ref:
88-
apiVersion: postgres-operator.crunchydata.com/v1beta1
92+
apiVersion: ($postgrescluster.apiVersion)
8993
kind: PostgresCluster
9094
name: clone-one
9195

@@ -162,7 +166,7 @@ spec:
162166
deletionPropagationPolicy: Background
163167
expect: [{ check: { (`true`): true } }]
164168
ref:
165-
apiVersion: postgres-operator.crunchydata.com/v1beta1
169+
apiVersion: ($postgrescluster.apiVersion)
166170
kind: PostgresCluster
167171
name: clone-two
168172

testing/chainsaw/e2e/pgbackrest-restore/templates/change-parameters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ spec:
5252
Update the cluster with parameters that require attention during recovery
5353
patch:
5454
resource:
55-
apiVersion: postgres-operator.crunchydata.com/v1beta1
55+
apiVersion: ($postgrescluster.apiVersion)
5656
kind: PostgresCluster
5757
metadata:
5858
name: original

testing/chainsaw/e2e/pgbackrest-restore/templates/clone-cluster.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
Clone the cluster using a pgBackRest restore
1414
apply:
1515
resource:
16-
apiVersion: postgres-operator.crunchydata.com/v1beta1
16+
apiVersion: ($postgrescluster.apiVersion)
1717
kind: PostgresCluster
1818
metadata:
1919
name: ($name)
@@ -39,7 +39,7 @@ spec:
3939
Wait for the cluster to come online
4040
assert:
4141
resource:
42-
apiVersion: postgres-operator.crunchydata.com/v1beta1
42+
apiVersion: ($postgrescluster.apiVersion)
4343
kind: PostgresCluster
4444
metadata:
4545
name: ($name)

testing/chainsaw/e2e/pgbackrest-restore/templates/create-backup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
Annotate the cluster to trigger a backup
1313
patch:
1414
resource:
15-
apiVersion: postgres-operator.crunchydata.com/v1beta1
15+
apiVersion: ($postgrescluster.apiVersion)
1616
kind: PostgresCluster
1717
metadata:
1818
name: original

testing/chainsaw/e2e/pgbackrest-restore/templates/create-cluster.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
and some parameters that require attention during PostgreSQL recovery
1111
apply:
1212
resource:
13-
apiVersion: postgres-operator.crunchydata.com/v1beta1
13+
apiVersion: ($postgrescluster.apiVersion)
1414
kind: PostgresCluster
1515
metadata:
1616
name: original
@@ -40,7 +40,7 @@ spec:
4040
Wait for the replica backup to complete
4141
assert:
4242
resource:
43-
apiVersion: postgres-operator.crunchydata.com/v1beta1
43+
apiVersion: ($postgrescluster.apiVersion)
4444
kind: PostgresCluster
4545
metadata:
4646
name: original

testing/chainsaw/e2e/pgbackrest-restore/templates/point-in-time-restore.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
Trigger an in-place point-in-time restore (PITR)
2626
patch:
2727
resource:
28-
apiVersion: postgres-operator.crunchydata.com/v1beta1
28+
apiVersion: ($postgrescluster.apiVersion)
2929
kind: PostgresCluster
3030
metadata:
3131
name: original
@@ -46,7 +46,7 @@ spec:
4646
Wait for the restore to complete and the cluster to come online
4747
assert:
4848
resource:
49-
apiVersion: postgres-operator.crunchydata.com/v1beta1
49+
apiVersion: ($postgrescluster.apiVersion)
5050
kind: PostgresCluster
5151
metadata:
5252
name: original

testing/chainsaw/e2e/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
versions:
22
postgres: '17'
3+
postgrescluster: 'v1'
34

45
images:
56
psql: 'registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi9-17.6-2542'

testing/kuttl/e2e/cluster-pause/files/00-cluster-created.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: postgres-operator.crunchydata.com/v1beta1
1+
apiVersion: postgres-operator.crunchydata.com/${KUTTL_PGCLUSTER_API_VERSION}
22
kind: PostgresCluster
33
metadata:
44
name: cluster-pause

testing/kuttl/e2e/cluster-pause/files/00-create-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: postgres-operator.crunchydata.com/v1beta1
1+
apiVersion: postgres-operator.crunchydata.com/${KUTTL_PGCLUSTER_API_VERSION}
22
kind: PostgresCluster
33
metadata:
44
name: cluster-pause

0 commit comments

Comments
 (0)