From c049fa7150e17eaac78879a3090d98533e4c50f1 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Fri, 29 Apr 2022 11:44:50 +0000 Subject: [PATCH] 5.0.8-debian-10-r8 release --- .../rootfs/opt/bitnami/scripts/libmongodb.sh | 11 ++++++++++- bitnami/mongodb/README.md | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bitnami/mongodb/5.0/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh b/bitnami/mongodb/5.0/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh index 32468500628e..e3a3d78bc71a 100644 --- a/bitnami/mongodb/5.0/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh +++ b/bitnami/mongodb/5.0/debian-10/rootfs/opt/bitnami/scripts/libmongodb.sh @@ -112,6 +112,12 @@ in the primary node and MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD in the rest of nod error_code=1 } + check_yes_no_value() { + if ! is_yes_no_value "${!1}" && ! is_true_false_value "${!1}"; then + print_validation_error "The allowed values for ${1} are: yes no" + fi + } + if [[ -n "$MONGODB_REPLICA_SET_MODE" ]]; then if [[ -z "$MONGODB_ADVERTISED_HOSTNAME" ]]; then warn "In order to use hostnames instead of IPs your should set MONGODB_ADVERTISED_HOSTNAME" @@ -152,6 +158,9 @@ Available options are 'primary/secondary/arbiter/hidden'" fi fi + check_yes_no_value "MONGODB_ENABLE_MAJORITY_READ" + [[ "$(mongodb_get_version)" =~ ^5\..\. ]] && ! is_boolean_yes "$MONGODB_ENABLE_MAJORITY_READ" && warn "MONGODB_ENABLE_MAJORITY_READ=${MONGODB_ENABLE_MAJORITY_READ} Will be ignored in MongoDB 5.0" + if [[ -n "$MONGODB_REPLICA_SET_KEY" ]] && ((${#MONGODB_REPLICA_SET_KEY} < 5)); then error_message="MONGODB_REPLICA_SET_KEY must be, at least, 5 characters long!" print_validation_error "$error_message" @@ -626,7 +635,7 @@ mongodb_set_replicasetmode_conf() { mongodb_config_apply_regex "replSetName:.*" "replSetName: $MONGODB_REPLICA_SET_NAME" "$conf_file_path" fi if [[ -n "$MONGODB_ENABLE_MAJORITY_READ" ]]; then - mongodb_config_apply_regex "enableMajorityReadConcern:.*" "enableMajorityReadConcern: $({ is_boolean_yes "$MONGODB_ENABLE_MAJORITY_READ" && echo 'true'; } || echo 'false')" "$conf_file_path" + mongodb_config_apply_regex "enableMajorityReadConcern:.*" "enableMajorityReadConcern: $({ (is_boolean_yes "$MONGODB_ENABLE_MAJORITY_READ" || [[ "$(mongodb_get_version)" =~ ^5\..\. ]]) && echo 'true'; } || echo 'false')" "$conf_file_path" fi else debug "$conf_file_name mounted. Skipping replicaset mode enabling" diff --git a/bitnami/mongodb/README.md b/bitnami/mongodb/README.md index e0d8bc662928..470ecceed664 100644 --- a/bitnami/mongodb/README.md +++ b/bitnami/mongodb/README.md @@ -45,7 +45,7 @@ Non-root container images add an extra layer of security and are generally recom Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/). -* [`5.0`, `5.0-debian-10`, `5.0.8`, `5.0.8-debian-10-r7`, `latest` (5.0/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/5.0.8-debian-10-r7/5.0/debian-10/Dockerfile) +* [`5.0`, `5.0-debian-10`, `5.0.8`, `5.0.8-debian-10-r8`, `latest` (5.0/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/5.0.8-debian-10-r8/5.0/debian-10/Dockerfile) * [`4.4`, `4.4-debian-10`, `4.4.13`, `4.4.13-debian-10-r58` (4.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.4.13-debian-10-r58/4.4/debian-10/Dockerfile) * [`4.2`, `4.2-debian-10`, `4.2.19`, `4.2.19-debian-10-r55` (4.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.2.19-debian-10-r55/4.2/debian-10/Dockerfile)