Skip to content

Commit f9e5124

Browse files
authored
K8SPG-613: use random location for start-from-backup source (#1203)
1 parent 1681f23 commit f9e5124

File tree

4 files changed

+6
-500
lines changed

4 files changed

+6
-500
lines changed

e2e-tests/functions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ get_cr() {
170170
cr_name=${test_name}
171171
fi
172172
local repo_path=$2
173+
local source_path=$3
173174

174175
yq eval '
175176
.metadata.name = "'${cr_name}'" |
@@ -210,7 +211,7 @@ get_cr() {
210211
yq eval -i '
211212
.spec.dataSource.pgbackrest.configuration = [{"secret":{"name":"'${test_name}'-pgbackrest-secrets"}}] |
212213
.spec.dataSource.pgbackrest.stanza = "db" |
213-
.spec.dataSource.pgbackrest.global.repo1-path = "/backrestrepo/postgres-operator/demand-backup-ppg'$PG_VER'/repo1" |
214+
.spec.dataSource.pgbackrest.global.repo1-path = "'${source_path}'" |
214215
.spec.dataSource.pgbackrest.repo = {"name":"repo1","s3":{"bucket":"'$BUCKET'","endpoint":"s3.amazonaws.com","region":"us-east-1"}}
215216
' $TEMP_DIR/cr.yaml
216217
fi

e2e-tests/tests/start-from-backup/01-create-source-cluster.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ commands:
88
99
source ../../functions
1010
11-
get_cr "start-from-backup-source" "demand-backup-ppg$PG_VER" \
11+
get_cr "start-from-backup-source" ${RANDOM} \
1212
| kubectl -n "${NAMESPACE}" apply -f -
13+

e2e-tests/tests/start-from-backup/06-create-cluster.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ commands:
77
set -o xtrace
88
99
source ../../functions
10-
11-
get_cr "start-from-backup" ${RANDOM}| kubectl -n "${NAMESPACE}" apply -f -
10+
destination=$(kubectl get perconapgbackup -n "${NAMESPACE}" start-from-backup-source-full-s3 -o jsonpath='{.status.destination}' | sed 's/^s3:\/\/pg-operator-testing//g')
11+
get_cr "start-from-backup" ${RANDOM} ${destination} | kubectl -n "${NAMESPACE}" apply -f -

0 commit comments

Comments
 (0)