Skip to content

Commit 876c9ef

Browse files
committed
adjust some verbiage, fix
1 parent 3391817 commit 876c9ef

8 files changed

Lines changed: 25 additions & 19 deletions

File tree

testing/chainsaw/e2e/pgbackrest-restore/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
This [chainsaw](https://github.com/kyverno/chainsaw) suite tests that CPK can clone and restore through pgBackRest backups.
44

5+
...other material here...

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
value: { accessModes: [ReadWriteOnce], resources: { requests: { storage: 1Gi } } }
2121

2222
steps:
23-
- name: 'Create Cluster'
23+
- name: 'Create Cluster with replica, tablespace'
2424
use:
2525
template: 'templates/create-cluster.yaml'
2626

@@ -36,8 +36,8 @@ spec:
3636
- name: command
3737
value: |
3838
CREATE SCHEMA IF NOT EXISTS "original";
39-
CREATE TABLE IF NOT EXISTS important (data) AS VALUES ('treasure');
40-
CREATE TABLE IF NOT EXISTS cows (name) TABLESPACE barn AS VALUES ('nellie');
39+
CREATE TABLE important (data) AS VALUES ('treasure');
40+
CREATE TABLE cows (name) TABLESPACE barn AS VALUES ('nellie');
4141
4242
- name: 'Create Backup #1'
4343
use:
@@ -53,7 +53,7 @@ spec:
5353
template: 'templates/clone-cluster.yaml'
5454
with:
5555
bindings:
56-
- name: target
56+
- name: name
5757
value: clone-one
5858

5959
- name: 'Verify Data on Clone #1'
@@ -90,8 +90,10 @@ spec:
9090
name: clone-one
9191

9292
- name: 'Restart Cluster'
93+
description: >
94+
Sets a timestamp and restarts the cluster, using the timestamp for comparison
9395
use:
94-
template: 'templates/timestamp-and-restart-cluster.yaml'
96+
template: 'templates/restart-cluster.yaml'
9597

9698
- name: 'Update Data'
9799
use:
@@ -123,7 +125,7 @@ spec:
123125
template: 'templates/clone-cluster.yaml'
124126
with:
125127
bindings:
126-
- name: target
128+
- name: name
127129
value: clone-two
128130

129131
- name: 'Verify Data on Clone #2'
@@ -160,6 +162,8 @@ spec:
160162
name: clone-two
161163

162164
- name: 'Lose Data'
165+
description: >
166+
Drop data and ensure that the data is dropped from the replica as well
163167
use:
164168
template: 'templates/lose-data.yaml'
165169

@@ -191,5 +195,7 @@ spec:
191195
END $$$$;
192196
193197
- name: 'Confirm Replica'
198+
description: >
199+
Verify that the data has streamed and is streaming to the replica
194200
use:
195201
template: 'templates/verify-replica.yaml'

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: clone-cluster
55
spec:
66
bindings:
7-
- name: target
7+
- name: name
88
value: 'The name of the new PostgresCluster'
99

1010
try:
@@ -16,7 +16,7 @@ spec:
1616
apiVersion: postgres-operator.crunchydata.com/v1beta1
1717
kind: PostgresCluster
1818
metadata:
19-
name: ($target)
19+
name: ($name)
2020
spec:
2121
dataSource:
2222
postgresCluster:
@@ -42,7 +42,7 @@ spec:
4242
apiVersion: postgres-operator.crunchydata.com/v1beta1
4343
kind: PostgresCluster
4444
metadata:
45-
name: ($target)
45+
name: ($name)
4646
status:
4747
instances:
4848
- name: '00'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121

2222
-
2323
description: >
24-
Wait for it to complete
24+
Wait for the backup to complete
2525
assert:
2626
resource:
2727
apiVersion: batch/v1

testing/chainsaw/e2e/pgbackrest-restore/templates/lose-data.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: chainsaw.kyverno.io/v1alpha1
22
kind: StepTemplate
33
metadata:
4-
name: 21-lose-data
4+
name: lose-data
55
spec:
66
try:
77
-
@@ -42,7 +42,7 @@ spec:
4242
4343
-
4444
description: >
45-
A reason to restore
45+
Drop tables
4646
command:
4747
skipCommandOutput: true
4848
env:
@@ -100,7 +100,7 @@ spec:
100100
101101
-
102102
description: >
103-
Confirm that the replica also needs to be restored
103+
Confirm that the replica also has lost the data that was dropped
104104
command:
105105
skipCommandOutput: true
106106
env:

testing/chainsaw/e2e/pgbackrest-restore/templates/psql-data.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222

2323
-
2424
description: >
25-
Create some data that will be restored
25+
Run a command through psql to create/verify data
2626
apply:
2727
resource:
2828
apiVersion: batch/v1
@@ -43,12 +43,13 @@ spec:
4343
valueFrom: { secretKeyRef: { name: ($secret), key: host } }
4444
- name: PGPORT
4545
valueFrom: { secretKeyRef: { name: ($secret), key: port } }
46+
# Always connect to the database using the original dbname, user, password
4647
- name: PGDATABASE
47-
valueFrom: { secretKeyRef: { name: ($secret), key: dbname } }
48+
valueFrom: { secretKeyRef: { name: original-pguser-original, key: dbname } }
4849
- name: PGUSER
49-
valueFrom: { secretKeyRef: { name: ($secret), key: user } }
50+
valueFrom: { secretKeyRef: { name: original-pguser-original, key: user } }
5051
- name: PGPASSWORD
51-
valueFrom: { secretKeyRef: { name: ($secret), key: password } }
52+
valueFrom: { secretKeyRef: { name: original-pguser-original, key: password } }
5253
command:
5354
- psql
5455
- -qa

testing/chainsaw/e2e/pgbackrest-restore/templates/timestamp-and-restart-cluster.yaml renamed to testing/chainsaw/e2e/pgbackrest-restore/templates/restart-cluster.yaml

File renamed without changes.

testing/chainsaw/e2e/pgbackrest-restore/templates/verify-replica.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ spec:
113113
114114
catch:
115115
-
116-
description: >
117-
Read all log lines from the job pods
118116
podLogs:
119117
selector: batch.kubernetes.io/job-name in (original-pitr-replica)
120118
tail: -1

0 commit comments

Comments
 (0)