Skip to content

Commit 47073d9

Browse files
committed
Merge remote-tracking branch 'origin/main' into K8SPSMDB-1211
2 parents e2b7e97 + 064d2b1 commit 47073d9

File tree

23 files changed

+336
-85
lines changed

23 files changed

+336
-85
lines changed

e2e-tests/demand-backup-incremental-sharded/run

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,16 @@ if [ -z "$SKIP_BACKUPS_TO_AWS_GCP_AZURE" ]; then
127127
run_backup azure-blob ${backup_name_azure}
128128

129129
wait_backup "${backup_name_aws}"
130+
check_backup_in_storage ${backup_name_aws} s3 rs0
131+
check_backup_in_storage ${backup_name_aws} s3 cfg
132+
130133
wait_backup "${backup_name_gcp}"
134+
check_backup_in_storage ${backup_name_gcp} gcs rs0
135+
check_backup_in_storage ${backup_name_gcp} gcs cfg
136+
131137
wait_backup "${backup_name_azure}"
138+
check_backup_in_storage ${backup_name_azure} azure rs0
139+
check_backup_in_storage ${backup_name_azure} azure cfg
132140
fi
133141

134142
backup_name_minio="backup-minio-sharded"

e2e-tests/demand-backup-incremental/run

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,13 @@ if [ -z "$SKIP_BACKUPS_TO_AWS_GCP_AZURE" ]; then
111111
run_backup azure-blob ${backup_name_azure}
112112

113113
wait_backup "${backup_name_aws}"
114+
check_backup_in_storage ${backup_name_aws} s3 rs0
115+
114116
wait_backup "${backup_name_gcp}"
117+
check_backup_in_storage ${backup_name_gcp} gcs rs0
118+
115119
wait_backup "${backup_name_azure}"
120+
check_backup_in_storage ${backup_name_azure} azure rs0
116121
fi
117122

118123
backup_name_minio="backup-minio"

e2e-tests/demand-backup-physical-sharded/run

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,16 @@ if [ -z "$SKIP_BACKUPS_TO_AWS_GCP_AZURE" ]; then
112112
run_backup azure-blob ${backup_name_azure}
113113

114114
wait_backup "${backup_name_aws}"
115+
check_backup_in_storage ${backup_name_aws} s3 rs0
116+
check_backup_in_storage ${backup_name_aws} s3 cfg
117+
115118
wait_backup "${backup_name_gcp}"
119+
check_backup_in_storage ${backup_name_gcp} gcs rs0
120+
check_backup_in_storage ${backup_name_gcp} gcs cfg
121+
116122
wait_backup "${backup_name_azure}"
123+
check_backup_in_storage ${backup_name_azure} azure rs0
124+
check_backup_in_storage ${backup_name_azure} azure cfg
117125
fi
118126
wait_backup "${backup_name_minio}"
119127

e2e-tests/demand-backup-physical/run

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,13 @@ if [ -z "$SKIP_BACKUPS_TO_AWS_GCP_AZURE" ]; then
9898
run_backup azure-blob ${backup_name_azure}
9999

100100
wait_backup "${backup_name_aws}"
101+
check_backup_in_storage ${backup_name_aws} s3 rs0
102+
101103
wait_backup "${backup_name_gcp}"
104+
check_backup_in_storage ${backup_name_gcp} gcs rs0
105+
102106
wait_backup "${backup_name_azure}"
107+
check_backup_in_storage ${backup_name_azure} azure rs0
103108
fi
104109
wait_backup "${backup_name_minio}"
105110

e2e-tests/functions

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ IMAGE_PMM_CLIENT=${IMAGE_PMM_CLIENT:-"perconalab/pmm-client:dev-latest"}
1717
IMAGE_PMM_SERVER=${IMAGE_PMM_SERVER:-"perconalab/pmm-server:dev-latest"}
1818
CERT_MANAGER_VER="1.16.3"
1919
UPDATE_COMPARE_FILES=${UPDATE_COMPARE_FILES:-0}
20+
DELETE_CRD_ON_START=${DELETE_CRD_ON_START:-1}
2021
tmp_dir=$(mktemp -d)
2122
sed=$(which gsed || which sed)
2223
date=$(which gdate || which date)
@@ -1331,8 +1332,10 @@ check_backup_deletion() {
13311332
create_infra() {
13321333
local ns="$1"
13331334

1334-
delete_crd
1335-
check_crd_for_deletion "${GIT_BRANCH}"
1335+
if [[ ${DELETE_CRD_ON_START} == 1 ]]; then
1336+
delete_crd
1337+
check_crd_for_deletion "${GIT_BRANCH}"
1338+
fi
13361339
if [ -n "$OPERATOR_NS" ]; then
13371340
create_namespace $OPERATOR_NS
13381341
deploy_operator
@@ -1867,3 +1870,31 @@ wait_for_oplogs() {
18671870
sleep 10
18681871
done
18691872
}
1873+
1874+
check_backup_in_storage() {
1875+
local backup=$1
1876+
local storage_type=$2
1877+
local replset=$3
1878+
local file=${4:-"filelist.pbm"}
1879+
1880+
local endpoint
1881+
case ${storage_type} in
1882+
s3)
1883+
endpoint="s3.amazonaws.com"
1884+
;;
1885+
gcs)
1886+
endpoint="storage.googleapis.com"
1887+
;;
1888+
azure)
1889+
endpoint="engk8soperators.blob.core.windows.net"
1890+
;;
1891+
*)
1892+
echo "unsupported storage type: ${storage_type}"
1893+
exit 1
1894+
esac
1895+
1896+
backup_dest=$(get_backup_dest "$backup")
1897+
local url="https://${endpoint}/${backup_dest}/${replset}/${file}"
1898+
log "checking if ${url} exists"
1899+
curl --fail --head "${url}"
1900+
}

e2e-tests/monitoring-2-0/compare/statefulset_monitoring-cfg-oc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ spec:
277277
- mountPath: /etc/mongodb-ssl
278278
name: ssl
279279
readOnly: true
280+
- mountPath: /data/db
281+
name: mongod-data
282+
readOnly: true
280283
dnsPolicy: ClusterFirst
281284
initContainers:
282285
- command:

e2e-tests/monitoring-2-0/compare/statefulset_monitoring-cfg.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ spec:
278278
- mountPath: /etc/mongodb-ssl
279279
name: ssl
280280
readOnly: true
281+
- mountPath: /data/db
282+
name: mongod-data
283+
readOnly: true
281284
dnsPolicy: ClusterFirst
282285
initContainers:
283286
- command:

e2e-tests/monitoring-2-0/compare/statefulset_monitoring-mongos-oc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ spec:
278278
- mountPath: /etc/mongodb-ssl
279279
name: ssl
280280
readOnly: true
281+
- mountPath: /data/db
282+
name: mongod-data
283+
readOnly: true
281284
dnsPolicy: ClusterFirst
282285
initContainers:
283286
- command:

e2e-tests/monitoring-2-0/compare/statefulset_monitoring-mongos.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ spec:
279279
- mountPath: /etc/mongodb-ssl
280280
name: ssl
281281
readOnly: true
282+
- mountPath: /data/db
283+
name: mongod-data
284+
readOnly: true
282285
dnsPolicy: ClusterFirst
283286
initContainers:
284287
- command:

e2e-tests/monitoring-2-0/compare/statefulset_monitoring-rs0-oc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ spec:
265265
- mountPath: /etc/mongodb-ssl
266266
name: ssl
267267
readOnly: true
268+
- mountPath: /data/db
269+
name: mongod-data
270+
readOnly: true
268271
dnsPolicy: ClusterFirst
269272
initContainers:
270273
- command:

0 commit comments

Comments
 (0)