Skip to content

Commit 5b8fc35

Browse files
authored
Merge branch 'main' into K8SPSMDB-1308
2 parents b3c332a + 064d2b1 commit 5b8fc35

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)
@@ -1361,8 +1362,10 @@ check_backup_deletion() {
13611362
create_infra() {
13621363
local ns="$1"
13631364

1364-
delete_crd
1365-
check_crd_for_deletion "${GIT_BRANCH}"
1365+
if [[ ${DELETE_CRD_ON_START} == 1 ]]; then
1366+
delete_crd
1367+
check_crd_for_deletion "${GIT_BRANCH}"
1368+
fi
13661369
if [ -n "$OPERATOR_NS" ]; then
13671370
create_namespace $OPERATOR_NS
13681371
deploy_operator
@@ -1897,3 +1900,31 @@ wait_for_oplogs() {
18971900
sleep 10
18981901
done
18991902
}
1903+
1904+
check_backup_in_storage() {
1905+
local backup=$1
1906+
local storage_type=$2
1907+
local replset=$3
1908+
local file=${4:-"filelist.pbm"}
1909+
1910+
local endpoint
1911+
case ${storage_type} in
1912+
s3)
1913+
endpoint="s3.amazonaws.com"
1914+
;;
1915+
gcs)
1916+
endpoint="storage.googleapis.com"
1917+
;;
1918+
azure)
1919+
endpoint="engk8soperators.blob.core.windows.net"
1920+
;;
1921+
*)
1922+
echo "unsupported storage type: ${storage_type}"
1923+
exit 1
1924+
esac
1925+
1926+
backup_dest=$(get_backup_dest "$backup")
1927+
local url="https://${endpoint}/${backup_dest}/${replset}/${file}"
1928+
log "checking if ${url} exists"
1929+
curl --fail --head "${url}"
1930+
}

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)