diff --git a/testing/kuttl/e2e/major-upgrade/01-assert.yaml b/testing/kuttl/e2e/major-upgrade/01-assert.yaml index f4cef66aa7..a8cd23794c 100644 --- a/testing/kuttl/e2e/major-upgrade/01-assert.yaml +++ b/testing/kuttl/e2e/major-upgrade/01-assert.yaml @@ -1,10 +1,7 @@ ---- -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PGUpgrade -metadata: - name: major-upgrade-do-it -status: - conditions: - - type: "Progressing" - status: "False" - reason: "PGUpgradeInvalid" +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/pgupgrade=major-upgrade-do-it diff --git a/testing/kuttl/e2e/major-upgrade/01-invalid-upgrade.yaml b/testing/kuttl/e2e/major-upgrade/01-invalid-upgrade.yaml new file mode 100644 index 0000000000..4e768cc1c3 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/01-invalid-upgrade.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/01-create-invalid-pgupgrade.yaml +assert: +- files/01-invalid-pgupgrade-created.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/02-assert.yaml b/testing/kuttl/e2e/major-upgrade/02-assert.yaml index 4df0ecc4d9..a8cd23794c 100644 --- a/testing/kuttl/e2e/major-upgrade/02-assert.yaml +++ b/testing/kuttl/e2e/major-upgrade/02-assert.yaml @@ -1,10 +1,7 @@ ---- -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PGUpgrade -metadata: - name: major-upgrade-do-it -status: - conditions: - - type: "Progressing" - status: "False" - reason: "PGClusterNotFound" +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/pgupgrade=major-upgrade-do-it diff --git a/testing/kuttl/e2e/major-upgrade/02-valid-upgrade.yaml b/testing/kuttl/e2e/major-upgrade/02-valid-upgrade.yaml new file mode 100644 index 0000000000..b03f4639d1 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/02-valid-upgrade.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/02-create-valid-upgrade.yaml +assert: +- files/02-valid-upgrade-created.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/10-already-upgraded-cluster.yaml b/testing/kuttl/e2e/major-upgrade/10-already-upgraded-cluster.yaml new file mode 100644 index 0000000000..0aedbc8079 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/10-already-upgraded-cluster.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/10-create-already-updated-cluster.yaml +assert: +- files/10-already-updated-cluster-created.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/10-assert.yaml b/testing/kuttl/e2e/major-upgrade/10-assert.yaml index 202864ef09..05354d1a27 100644 --- a/testing/kuttl/e2e/major-upgrade/10-assert.yaml +++ b/testing/kuttl/e2e/major-upgrade/10-assert.yaml @@ -1,11 +1,11 @@ ---- -# pgupgrade should exit since the cluster is already at the requested version -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PGUpgrade -metadata: - name: major-upgrade-do-it -status: - conditions: - - type: "Progressing" - status: "False" - reason: "PGUpgradeResolved" +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pods --selector postgres-operator.crunchydata.com/cluster=major-upgrade +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/cluster=major-upgrade +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/pgupgrade=major-upgrade-do-it diff --git a/testing/kuttl/e2e/major-upgrade/30-assert.yaml b/testing/kuttl/e2e/major-upgrade/30-assert.yaml index 1db8ec257d..05354d1a27 100644 --- a/testing/kuttl/e2e/major-upgrade/30-assert.yaml +++ b/testing/kuttl/e2e/major-upgrade/30-assert.yaml @@ -1,31 +1,11 @@ ---- -# Wait for the instances to be ready and the replica backup to complete -# by waiting for the status to signal pods ready and pgbackrest stanza created -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PostgresCluster -metadata: - name: major-upgrade -spec: - postgresVersion: ${KUTTL_PG_UPGRADE_FROM_VERSION} -status: - instances: - - name: '00' - replicas: 3 - readyReplicas: 3 - updatedReplicas: 3 - pgbackrest: - repos: - - name: repo1 - replicaCreateBackupComplete: true - stanzaCreated: true ---- -# Even when the cluster exists, the pgupgrade is not progressing because the cluster is not shutdown -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PGUpgrade -metadata: - name: major-upgrade-do-it -status: - conditions: - - type: "Progressing" - status: "False" - reason: "PGClusterNotShutdown" +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pods --selector postgres-operator.crunchydata.com/cluster=major-upgrade +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/cluster=major-upgrade +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/pgupgrade=major-upgrade-do-it diff --git a/testing/kuttl/e2e/major-upgrade/30-cluster.yaml b/testing/kuttl/e2e/major-upgrade/30-cluster.yaml new file mode 100644 index 0000000000..f99791bd88 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/30-cluster.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/30-create-cluster.yaml +assert: +- files/30-cluster-created.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/31-data.yaml b/testing/kuttl/e2e/major-upgrade/31-data.yaml new file mode 100644 index 0000000000..5bb8579ba5 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/31-data.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/31-create-data.yaml +assert: +- files/31-data-created.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/32-assert.yaml b/testing/kuttl/e2e/major-upgrade/32-assert.yaml index 2ad7f2869a..05354d1a27 100644 --- a/testing/kuttl/e2e/major-upgrade/32-assert.yaml +++ b/testing/kuttl/e2e/major-upgrade/32-assert.yaml @@ -1,11 +1,11 @@ ---- -# Since the cluster is missing the annotation, we get this condition -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PGUpgrade -metadata: - name: major-upgrade-do-it -status: - conditions: - - type: "Progressing" - status: "False" - reason: "PGClusterMissingRequiredAnnotation" +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pods --selector postgres-operator.crunchydata.com/cluster=major-upgrade +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/cluster=major-upgrade +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/pgupgrade=major-upgrade-do-it diff --git a/testing/kuttl/e2e/major-upgrade/32-shutdown.yaml b/testing/kuttl/e2e/major-upgrade/32-shutdown.yaml new file mode 100644 index 0000000000..edf4d1aebb --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/32-shutdown.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/32-shutdown-cluster.yaml +assert: +- files/32-cluster-shutdown.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/33-annotate.yaml b/testing/kuttl/e2e/major-upgrade/33-annotate.yaml new file mode 100644 index 0000000000..898336f3c5 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/33-annotate.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/33-annotate-cluster.yaml +assert: +- files/33-cluster-annotated.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/33-assert.yaml b/testing/kuttl/e2e/major-upgrade/33-assert.yaml index aadb5e3bb1..05354d1a27 100644 --- a/testing/kuttl/e2e/major-upgrade/33-assert.yaml +++ b/testing/kuttl/e2e/major-upgrade/33-assert.yaml @@ -1,22 +1,11 @@ ---- -# Now that the postgres cluster is shut down and annotated, the pgupgrade -# can finish reconciling. We know the reconciling is complete when -# the pgupgrade status is succeeded and the postgres cluster status -# has the updated version. -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PGUpgrade -metadata: - name: major-upgrade-do-it -status: - conditions: - - type: "Progressing" - status: "False" - - type: "Succeeded" - status: "True" ---- -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PostgresCluster -metadata: - name: major-upgrade -status: - postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION} +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pods --selector postgres-operator.crunchydata.com/cluster=major-upgrade +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/cluster=major-upgrade +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/pgupgrade=major-upgrade-do-it diff --git a/testing/kuttl/e2e/major-upgrade/34-assert.yaml b/testing/kuttl/e2e/major-upgrade/34-assert.yaml index aba583f74c..05354d1a27 100644 --- a/testing/kuttl/e2e/major-upgrade/34-assert.yaml +++ b/testing/kuttl/e2e/major-upgrade/34-assert.yaml @@ -1,18 +1,11 @@ ---- -# Wait for the instances to be ready with the target Postgres version. -apiVersion: postgres-operator.crunchydata.com/v1beta1 -kind: PostgresCluster -metadata: - name: major-upgrade -status: - postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION} - instances: - - name: '00' - replicas: 3 - readyReplicas: 3 - updatedReplicas: 3 - pgbackrest: - repos: - - name: repo1 - replicaCreateBackupComplete: true - stanzaCreated: true +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pods --selector postgres-operator.crunchydata.com/cluster=major-upgrade +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/cluster=major-upgrade +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/pgupgrade=major-upgrade-do-it diff --git a/testing/kuttl/e2e/major-upgrade/34-restart.yaml b/testing/kuttl/e2e/major-upgrade/34-restart.yaml new file mode 100644 index 0000000000..e6f0821df9 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/34-restart.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/34-restart-cluster.yaml +assert: +- files/34-cluster-restarted.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/35-check-pgbackrest-and-replica.yaml b/testing/kuttl/e2e/major-upgrade/35-assert.yaml similarity index 65% rename from testing/kuttl/e2e/major-upgrade/35-check-pgbackrest-and-replica.yaml rename to testing/kuttl/e2e/major-upgrade/35-assert.yaml index be1c3ff357..57ea08db11 100644 --- a/testing/kuttl/e2e/major-upgrade/35-check-pgbackrest-and-replica.yaml +++ b/testing/kuttl/e2e/major-upgrade/35-assert.yaml @@ -1,5 +1,5 @@ apiVersion: kuttl.dev/v1beta1 -kind: TestStep +kind: TestAssert commands: # Check that the pgbackrest setup has successfully completed - script: | @@ -9,3 +9,10 @@ commands: # Check that the old pg folders do not exist on the replica REPLICA=$(kubectl get pod -l=postgres-operator.crunchydata.com/role=replica -n "${NAMESPACE}" -o=jsonpath='{ .items[0].metadata.name }') kubectl -n "${NAMESPACE}" exec "${REPLICA}" -c database -- [ ! -d "pgdata/pg${KUTTL_PG_UPGRADE_FROM_VERSION}" ] +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pods --selector postgres-operator.crunchydata.com/cluster=major-upgrade +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/cluster=major-upgrade diff --git a/testing/kuttl/e2e/major-upgrade/36-assert.yaml b/testing/kuttl/e2e/major-upgrade/36-assert.yaml index a545bfd756..05354d1a27 100644 --- a/testing/kuttl/e2e/major-upgrade/36-assert.yaml +++ b/testing/kuttl/e2e/major-upgrade/36-assert.yaml @@ -1,14 +1,11 @@ ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: major-upgrade-after -status: - succeeded: 1 ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: major-upgrade-after-replica -status: - succeeded: 1 +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: +- type: command + command: kubectl -n $NAMESPACE describe pods --selector postgres-operator.crunchydata.com/cluster=major-upgrade +- type: command + command: kubectl -n $NAMESPACE describe pgupgrade major-upgrade-do-it +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/cluster=major-upgrade +- namespace: $NAMESPACE + selector: postgres-operator.crunchydata.com/pgupgrade=major-upgrade-do-it diff --git a/testing/kuttl/e2e/major-upgrade/36-restart.yaml b/testing/kuttl/e2e/major-upgrade/36-restart.yaml new file mode 100644 index 0000000000..19cc772538 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/36-restart.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/36-check-data-and-version.yaml +assert: +- files/36-data-and-version-checked.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/01--invalid-pgupgrade.yaml b/testing/kuttl/e2e/major-upgrade/files/01-create-invalid-pgupgrade.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/01--invalid-pgupgrade.yaml rename to testing/kuttl/e2e/major-upgrade/files/01-create-invalid-pgupgrade.yaml diff --git a/testing/kuttl/e2e/major-upgrade/files/01-invalid-pgupgrade-created.yaml b/testing/kuttl/e2e/major-upgrade/files/01-invalid-pgupgrade-created.yaml new file mode 100644 index 0000000000..f4cef66aa7 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/01-invalid-pgupgrade-created.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PGUpgrade +metadata: + name: major-upgrade-do-it +status: + conditions: + - type: "Progressing" + status: "False" + reason: "PGUpgradeInvalid" diff --git a/testing/kuttl/e2e/major-upgrade/02--valid-upgrade.yaml b/testing/kuttl/e2e/major-upgrade/files/02-create-valid-upgrade.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/02--valid-upgrade.yaml rename to testing/kuttl/e2e/major-upgrade/files/02-create-valid-upgrade.yaml diff --git a/testing/kuttl/e2e/major-upgrade/files/02-valid-upgrade-created.yaml b/testing/kuttl/e2e/major-upgrade/files/02-valid-upgrade-created.yaml new file mode 100644 index 0000000000..4df0ecc4d9 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/02-valid-upgrade-created.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PGUpgrade +metadata: + name: major-upgrade-do-it +status: + conditions: + - type: "Progressing" + status: "False" + reason: "PGClusterNotFound" diff --git a/testing/kuttl/e2e/major-upgrade/files/10-already-updated-cluster-created.yaml b/testing/kuttl/e2e/major-upgrade/files/10-already-updated-cluster-created.yaml new file mode 100644 index 0000000000..202864ef09 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/10-already-updated-cluster-created.yaml @@ -0,0 +1,11 @@ +--- +# pgupgrade should exit since the cluster is already at the requested version +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PGUpgrade +metadata: + name: major-upgrade-do-it +status: + conditions: + - type: "Progressing" + status: "False" + reason: "PGUpgradeResolved" diff --git a/testing/kuttl/e2e/major-upgrade/10--already-updated-cluster.yaml b/testing/kuttl/e2e/major-upgrade/files/10-create-already-updated-cluster.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/10--already-updated-cluster.yaml rename to testing/kuttl/e2e/major-upgrade/files/10-create-already-updated-cluster.yaml diff --git a/testing/kuttl/e2e/major-upgrade/files/30-cluster-created.yaml b/testing/kuttl/e2e/major-upgrade/files/30-cluster-created.yaml new file mode 100644 index 0000000000..1db8ec257d --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/30-cluster-created.yaml @@ -0,0 +1,31 @@ +--- +# Wait for the instances to be ready and the replica backup to complete +# by waiting for the status to signal pods ready and pgbackrest stanza created +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PostgresCluster +metadata: + name: major-upgrade +spec: + postgresVersion: ${KUTTL_PG_UPGRADE_FROM_VERSION} +status: + instances: + - name: '00' + replicas: 3 + readyReplicas: 3 + updatedReplicas: 3 + pgbackrest: + repos: + - name: repo1 + replicaCreateBackupComplete: true + stanzaCreated: true +--- +# Even when the cluster exists, the pgupgrade is not progressing because the cluster is not shutdown +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PGUpgrade +metadata: + name: major-upgrade-do-it +status: + conditions: + - type: "Progressing" + status: "False" + reason: "PGClusterNotShutdown" diff --git a/testing/kuttl/e2e/major-upgrade/30--cluster.yaml b/testing/kuttl/e2e/major-upgrade/files/30-create-cluster.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/30--cluster.yaml rename to testing/kuttl/e2e/major-upgrade/files/30-create-cluster.yaml diff --git a/testing/kuttl/e2e/major-upgrade/31--create-data.yaml b/testing/kuttl/e2e/major-upgrade/files/31-create-data.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/31--create-data.yaml rename to testing/kuttl/e2e/major-upgrade/files/31-create-data.yaml diff --git a/testing/kuttl/e2e/major-upgrade/31-assert.yaml b/testing/kuttl/e2e/major-upgrade/files/31-data-created.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/31-assert.yaml rename to testing/kuttl/e2e/major-upgrade/files/31-data-created.yaml diff --git a/testing/kuttl/e2e/major-upgrade/files/32-cluster-shutdown.yaml b/testing/kuttl/e2e/major-upgrade/files/32-cluster-shutdown.yaml new file mode 100644 index 0000000000..2ad7f2869a --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/32-cluster-shutdown.yaml @@ -0,0 +1,11 @@ +--- +# Since the cluster is missing the annotation, we get this condition +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PGUpgrade +metadata: + name: major-upgrade-do-it +status: + conditions: + - type: "Progressing" + status: "False" + reason: "PGClusterMissingRequiredAnnotation" diff --git a/testing/kuttl/e2e/major-upgrade/32--shutdown-cluster.yaml b/testing/kuttl/e2e/major-upgrade/files/32-shutdown-cluster.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/32--shutdown-cluster.yaml rename to testing/kuttl/e2e/major-upgrade/files/32-shutdown-cluster.yaml diff --git a/testing/kuttl/e2e/major-upgrade/33--annotate-cluster.yaml b/testing/kuttl/e2e/major-upgrade/files/33-annotate-cluster.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/33--annotate-cluster.yaml rename to testing/kuttl/e2e/major-upgrade/files/33-annotate-cluster.yaml diff --git a/testing/kuttl/e2e/major-upgrade/files/33-cluster-annotated.yaml b/testing/kuttl/e2e/major-upgrade/files/33-cluster-annotated.yaml new file mode 100644 index 0000000000..aadb5e3bb1 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/33-cluster-annotated.yaml @@ -0,0 +1,22 @@ +--- +# Now that the postgres cluster is shut down and annotated, the pgupgrade +# can finish reconciling. We know the reconciling is complete when +# the pgupgrade status is succeeded and the postgres cluster status +# has the updated version. +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PGUpgrade +metadata: + name: major-upgrade-do-it +status: + conditions: + - type: "Progressing" + status: "False" + - type: "Succeeded" + status: "True" +--- +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PostgresCluster +metadata: + name: major-upgrade +status: + postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION} diff --git a/testing/kuttl/e2e/major-upgrade/files/34-cluster-restarted.yaml b/testing/kuttl/e2e/major-upgrade/files/34-cluster-restarted.yaml new file mode 100644 index 0000000000..aba583f74c --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/34-cluster-restarted.yaml @@ -0,0 +1,18 @@ +--- +# Wait for the instances to be ready with the target Postgres version. +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PostgresCluster +metadata: + name: major-upgrade +status: + postgresVersion: ${KUTTL_PG_UPGRADE_TO_VERSION} + instances: + - name: '00' + replicas: 3 + readyReplicas: 3 + updatedReplicas: 3 + pgbackrest: + repos: + - name: repo1 + replicaCreateBackupComplete: true + stanzaCreated: true diff --git a/testing/kuttl/e2e/major-upgrade/34--restart-cluster.yaml b/testing/kuttl/e2e/major-upgrade/files/34-restart-cluster.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/34--restart-cluster.yaml rename to testing/kuttl/e2e/major-upgrade/files/34-restart-cluster.yaml diff --git a/testing/kuttl/e2e/major-upgrade/36--check-data-and-version.yaml b/testing/kuttl/e2e/major-upgrade/files/36-check-data-and-version.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/36--check-data-and-version.yaml rename to testing/kuttl/e2e/major-upgrade/files/36-check-data-and-version.yaml diff --git a/testing/kuttl/e2e/major-upgrade/files/36-data-and-version-checked.yaml b/testing/kuttl/e2e/major-upgrade/files/36-data-and-version-checked.yaml new file mode 100644 index 0000000000..a545bfd756 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/36-data-and-version-checked.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: major-upgrade-after +status: + succeeded: 1 +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: major-upgrade-after-replica +status: + succeeded: 1 diff --git a/testing/kuttl/e2e/major-upgrade/20-assert.yaml b/testing/kuttl/e2e/major-upgrade/files/currently-unused/20-cluster-with-invalid-version-created.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/20-assert.yaml rename to testing/kuttl/e2e/major-upgrade/files/currently-unused/20-cluster-with-invalid-version-created.yaml diff --git a/testing/kuttl/e2e/major-upgrade/files/currently-unused/20-cluster-with-invalid-version.yaml b/testing/kuttl/e2e/major-upgrade/files/currently-unused/20-cluster-with-invalid-version.yaml new file mode 100644 index 0000000000..36266e8fa7 --- /dev/null +++ b/testing/kuttl/e2e/major-upgrade/files/currently-unused/20-cluster-with-invalid-version.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +apply: +- files/20-create-cluster-with-invalid-version.yaml +assert: +- files/20-cluster-with-invalid-version-created.yaml \ No newline at end of file diff --git a/testing/kuttl/e2e/major-upgrade/20--cluster-with-invalid-version.yaml b/testing/kuttl/e2e/major-upgrade/files/currently-unused/20-create-cluster-with-invalid-version.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/20--cluster-with-invalid-version.yaml rename to testing/kuttl/e2e/major-upgrade/files/currently-unused/20-create-cluster-with-invalid-version.yaml diff --git a/testing/kuttl/e2e/major-upgrade/21-delete-cluster.yaml b/testing/kuttl/e2e/major-upgrade/files/currently-unused/21-delete-cluster.yaml similarity index 100% rename from testing/kuttl/e2e/major-upgrade/21-delete-cluster.yaml rename to testing/kuttl/e2e/major-upgrade/files/currently-unused/21-delete-cluster.yaml