File tree Expand file tree Collapse file tree 4 files changed +36
-2
lines changed Expand file tree Collapse file tree 4 files changed +36
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
1
2
apiVersion : postgres-operator.crunchydata.com/v1beta1
2
3
kind : PostgresCluster
3
4
metadata :
@@ -9,6 +10,22 @@ status:
9
10
replicas : 2
10
11
updatedReplicas : 2
11
12
---
13
+ # Patroni labels and readiness happen separately.
14
+ # The next step expects to find pods by their role label; wait for them here.
15
+ apiVersion : v1
16
+ kind : Pod
17
+ metadata :
18
+ labels :
19
+ postgres-operator.crunchydata.com/cluster : delete-switchover
20
+ postgres-operator.crunchydata.com/role : master
21
+ ---
22
+ apiVersion : v1
23
+ kind : Pod
24
+ metadata :
25
+ labels :
26
+ postgres-operator.crunchydata.com/cluster : delete-switchover
27
+ postgres-operator.crunchydata.com/role : replica
28
+ ---
12
29
apiVersion : batch/v1
13
30
kind : Job
14
31
metadata :
Original file line number Diff line number Diff line change 2
2
apiVersion : kuttl.dev/v1beta1
3
3
kind : TestStep
4
4
commands :
5
- # Label instance pods with their current role for assert
5
+ # Label instance pods with their current role. These labels will stick around
6
+ # because switchover does not recreate any pods.
6
7
- script : |
7
8
kubectl label --namespace="${NAMESPACE}" pods \
8
9
--selector='postgres-operator.crunchydata.com/role=master' \
Original file line number Diff line number Diff line change 1
1
---
2
- # After switchover, a former replica should now be the primary.
2
+ # Wait for switchover to finish. A former replica should now be the primary.
3
3
apiVersion : v1
4
4
kind : Pod
5
5
metadata :
Original file line number Diff line number Diff line change 9
9
replicas : 2
10
10
readyReplicas : 2
11
11
updatedReplicas : 2
12
+ ---
13
+ # Patroni labels and readiness happen separately.
14
+ # The next step expects to find pods by their role label; wait for them here.
15
+ apiVersion : v1
16
+ kind : Pod
17
+ metadata :
18
+ labels :
19
+ postgres-operator.crunchydata.com/cluster : switchover
20
+ postgres-operator.crunchydata.com/role : master
21
+ ---
22
+ apiVersion : v1
23
+ kind : Pod
24
+ metadata :
25
+ labels :
26
+ postgres-operator.crunchydata.com/cluster : switchover
27
+ postgres-operator.crunchydata.com/role : replica
You can’t perform that action at this time.
0 commit comments