Skip to content

Commit 0ae6b24

Browse files
committed
stanza-delete
1 parent eb5da3b commit 0ae6b24

16 files changed

+144
-72
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
- timeout: 300
5+
script: |-
6+
set -o errexit
7+
set -o xtrace
8+
9+
source ../../functions
10+
11+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
12+
kubectl -n ${NAMESPACE} exec ${pod} -- touch /pgdata/sleep-forever
13+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stop
14+
done
15+
16+
pod=$(kubectl get -n ${NAMESPACE} pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | tail -n 1 | awk '{print $1}')
17+
18+
kubectl -n ${NAMESPACE} exec ${pod} -- patronictl pause
19+
20+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
21+
kubectl -n ${NAMESPACE} exec ${pod} -- pg_ctl -D /pgdata/pg14 stop
22+
done
23+
24+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stanza-delete
25+
26+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
27+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug start
28+
kubectl -n ${NAMESPACE} exec ${pod} -- rm /pgdata/sleep-forever
29+
done
30+
31+
kubectl -n ${NAMESPACE} exec ${pod} -- patronictl resume
32+
33+
# give some time to patroni for starting postgres
34+
sleep 90
35+
36+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stanza-create

e2e-tests/tests/major-upgrade/23-switch-wal.yaml

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
- timeout: 300
5+
script: |-
6+
set -o errexit
7+
set -o xtrace
8+
9+
source ../../functions
10+
11+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
12+
kubectl -n ${NAMESPACE} exec ${pod} -- touch /pgdata/sleep-forever
13+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stop
14+
done
15+
16+
pod=$(kubectl get -n ${NAMESPACE} pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | tail -n 1 | awk '{print $1}')
17+
18+
kubectl -n ${NAMESPACE} exec ${pod} -- patronictl pause
19+
20+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
21+
kubectl -n ${NAMESPACE} exec ${pod} -- pg_ctl -D /pgdata/pg15 stop
22+
done
23+
24+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stanza-delete
25+
26+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
27+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug start
28+
kubectl -n ${NAMESPACE} exec ${pod} -- rm /pgdata/sleep-forever
29+
done
30+
31+
kubectl -n ${NAMESPACE} exec ${pod} -- patronictl resume
32+
33+
# give some time to patroni for starting postgres
34+
sleep 90
35+
36+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stanza-create

e2e-tests/tests/major-upgrade/33-switch-wal.yaml

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
- timeout: 300
5+
script: |-
6+
set -o errexit
7+
set -o xtrace
8+
9+
source ../../functions
10+
11+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
12+
kubectl -n ${NAMESPACE} exec ${pod} -- touch /pgdata/sleep-forever
13+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stop
14+
done
15+
16+
pod=$(kubectl get -n ${NAMESPACE} pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | tail -n 1 | awk '{print $1}')
17+
18+
kubectl -n ${NAMESPACE} exec ${pod} -- patronictl pause
19+
20+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
21+
kubectl -n ${NAMESPACE} exec ${pod} -- pg_ctl -D /pgdata/pg16 stop
22+
done
23+
24+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stanza-delete
25+
26+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
27+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug start
28+
kubectl -n ${NAMESPACE} exec ${pod} -- rm /pgdata/sleep-forever
29+
done
30+
31+
kubectl -n ${NAMESPACE} exec ${pod} -- patronictl resume
32+
33+
# give some time to patroni for starting postgres
34+
sleep 90
35+
36+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stanza-create

e2e-tests/tests/major-upgrade/43-switch-wal.yaml

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
- timeout: 300
5+
script: |-
6+
set -o errexit
7+
set -o xtrace
8+
9+
source ../../functions
10+
11+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
12+
kubectl -n ${NAMESPACE} exec ${pod} -- touch /pgdata/sleep-forever
13+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stop
14+
done
15+
16+
pod=$(kubectl get -n ${NAMESPACE} pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | tail -n 1 | awk '{print $1}')
17+
18+
kubectl -n ${NAMESPACE} exec ${pod} -- patronictl pause
19+
20+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
21+
kubectl -n ${NAMESPACE} exec ${pod} -- pg_ctl -D /pgdata/pg17 stop
22+
done
23+
24+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stanza-delete
25+
26+
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
27+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug start
28+
kubectl -n ${NAMESPACE} exec ${pod} -- rm /pgdata/sleep-forever
29+
done
30+
31+
kubectl -n ${NAMESPACE} exec ${pod} -- patronictl resume
32+
33+
# give some time to patroni for starting postgres
34+
sleep 90
35+
36+
kubectl -n ${NAMESPACE} exec ${pod} -- pgbackrest --stanza=db --log-level-console=debug stanza-create

e2e-tests/tests/major-upgrade/53-switch-wal.yaml

-18
This file was deleted.

0 commit comments

Comments
 (0)