Skip to content

Commit 76e17e3

Browse files
inelpandzicgithub-actions[bot]tplavcichors
authored
K8SPSMDB-1013: Mongo 7 support (#1470)
* Add 7.0 to entrypoint. * Add checks for v7.0 in choosing mongosh. * Properly get mongosh shell for v7.0. * Update pkg/controller/perconaservermongodb/mgo.go Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update pkg/controller/perconaservermongodbrestore/physical.go Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update e2e tests. * Fix e2e test. * Update build/ps-entry.sh Co-authored-by: Tomislav Plavcic <[email protected]> * Update build/ps-entry.sh Co-authored-by: Tomislav Plavcic <[email protected]> * Update build/ps-entry.sh Co-authored-by: Tomislav Plavcic <[email protected]> * Update e2e-tests/cross-site-sharded/run Co-authored-by: Tomislav Plavcic <[email protected]> * Update e2e-tests/data-sharded/run Co-authored-by: Tomislav Plavcic <[email protected]> * Refactor to check if versions are 4.4 or 5.0. * Disable backups in config for mongod-major-upgrade test * Add 7.0 support for major upgrade check in version.go * Fix SetFCV function to support MongoDB 7.0 * Disable backups in mongod-major-upgrade-sharded test * Fix mongod-major-upgrade and mongod-major-upgrade-sharded tests * Update default version. * Remove mongodb 4.4 from tests. * Update init-deploy test. * Fix init-deploy test. * Fix TestReconcileStatefulSet test. * Set IMAGE_MONGOD to 7.0 * Update backup-70.json * Update init-deploy test. * Increase max_conn to 13. * Fix getting right mongo client for physical restore. * Update version-service test. * Update version-service test. * Update init-deploy test. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tomislav Plavcic <[email protected]> Co-authored-by: Tomislav Plavcic <[email protected]> Co-authored-by: Viacheslav Sarzhan <[email protected]>
1 parent d4fb935 commit 76e17e3

File tree

26 files changed

+1263
-23
lines changed

26 files changed

+1263
-23
lines changed

build/ps-entry.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ fi
3434
MONGODB_VERSION=$(mongod --version | head -1 | awk '{print $3}' | awk -F'.' '{print $1"."$2}')
3535

3636
mongo_shell="env HOME=${TMPDIR:-/tmp} mongosh"
37-
if [ "$MONGODB_VERSION" != 'v6.0' ]; then
38-
echo "MongoDB version $MONGODB_VERSION present, using mongo shell"
37+
if [ "$MONGODB_VERSION" == 'v4.4' ] || [ "$MONGODB_VERSION" == 'v5.0' ]; then
38+
echo "MongoDB version $MONGODB_VERSION present, using old mongo client"
3939
mongo_shell=mongo
4040
fi
4141

deploy/cr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
# pause: true
1313
# unmanaged: false
1414
crVersion: 1.16.0
15-
image: perconalab/percona-server-mongodb-operator:main-mongod6.0
15+
image: perconalab/percona-server-mongodb-operator:main-mongod7.0
1616
imagePullPolicy: Always
1717
# tls:
1818
# # 90 days in hours

e2e-tests/cross-site-sharded/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ desc 'Check chunks'
5858
chunks_param1="ns"
5959
chunks_param2='"app.city"'
6060

61-
if [[ ${MONGO_VER} == "6.0" || ${MONGO_VER} == "5.0" ]]; then
61+
if [[ ${MONGO_VER} != "4.4" ]]; then
6262
chunks_param1="uuid"
6363
chunks_param2=$(run_mongos \
6464
"use app\n db.getCollectionInfos({ \"name\": \"city\" })[0].info.uuid" \

e2e-tests/data-sharded/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ main() {
8888
chunks_param1="ns"
8989
chunks_param2='"app.city"'
9090

91-
if [[ ${MONGO_VER} == "6.0" || ${MONGO_VER} == "5.0" ]]; then
91+
if [[ ${MONGO_VER} != "4.4" ]]; then
9292
chunks_param1="uuid"
9393
chunks_param2=$(run_mongos \
9494
"use app\n db.getCollectionInfos({ \"name\": \"city\" })[0].info.uuid" \

e2e-tests/functions

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ GIT_BRANCH=${VERSION:-$(git rev-parse --abbrev-ref HEAD | sed -e 's^/^-^g; s^[.]
55
API="psmdb.percona.com/v1"
66
OPERATOR_VERSION="$(grep 'crVersion' $(realpath $(dirname ${BASH_SOURCE[0]})/../deploy/cr.yaml) | awk '{print $2}')"
77
IMAGE=${IMAGE:-"perconalab/percona-server-mongodb-operator:${GIT_BRANCH}"}
8-
IMAGE_MONGOD=${IMAGE_MONGOD:-"perconalab/percona-server-mongodb-operator:main-mongod5.0"}
8+
IMAGE_MONGOD=${IMAGE_MONGOD:-"perconalab/percona-server-mongodb-operator:main-mongod7.0"}
99
IMAGE_MONGOD_CHAIN=${IMAGE_MONGOD_CHAIN:-$'
10-
perconalab/percona-server-mongodb-operator:main-mongod4.4
1110
perconalab/percona-server-mongodb-operator:main-mongod5.0
12-
perconalab/percona-server-mongodb-operator:main-mongod6.0'}
11+
12+
perconalab/percona-server-mongodb-operator:main-mongod6.0
13+
perconalab/percona-server-mongodb-operator:main-mongod7.0'}
1314
IMAGE_BACKUP=${IMAGE_BACKUP:-"perconalab/percona-server-mongodb-operator:main-backup"}
1415
SKIP_BACKUPS_TO_AWS_GCP_AZURE=${SKIP_BACKUPS_TO_AWS_GCP_AZURE:-1}
1516
PMM_SERVER_VER=${PMM_SERVER_VER:-"9.9.9"}
@@ -843,6 +844,9 @@ compare_mongo_user() {
843844
if [[ $IMAGE_MONGOD =~ 6\.0 ]] && [ -f ${test_dir}/compare/$user-60.json ]; then
844845
expected_result=${test_dir}/compare/$user-60.json
845846
fi
847+
if [[ $IMAGE_MONGOD =~ 7\.0 ]] && [ -f ${test_dir}/compare/$user-70.json ]; then
848+
expected_result=${test_dir}/compare/$user-70.json
849+
fi
846850

847851
run_mongo 'db.runCommand({connectionStatus:1,showPrivileges:true})' "$uri" \
848852
| egrep -v "Time|Percona Server for MongoDB|bye|BinData|NumberLong|connecting to|Error saving history file|I NETWORK|W NETWORK|Implicit session:|versions do not match" \

0 commit comments

Comments
 (0)