From 4eb2c17ef2032f7f946c553fa3be93542792aa25 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Wed, 5 Jan 2022 20:02:52 +0000 Subject: [PATCH] 4.0.27-debian-9-r111 release --- bitnami/mongodb/4.0/debian-9/Dockerfile | 4 +- .../opt/bitnami/.bitnami_components.json | 4 +- .../rootfs/opt/bitnami/scripts/libmongodb.sh | 94 ++++++++++++++++++- bitnami/mongodb/README.md | 2 +- 4 files changed, 95 insertions(+), 9 deletions(-) diff --git a/bitnami/mongodb/4.0/debian-9/Dockerfile b/bitnami/mongodb/4.0/debian-9/Dockerfile index 1966b497e263..b1fe11213cfe 100644 --- a/bitnami/mongodb/4.0/debian-9/Dockerfile +++ b/bitnami/mongodb/4.0/debian-9/Dockerfile @@ -12,14 +12,14 @@ RUN install_packages acl ca-certificates curl gzip libc6 libcomerr2 libcurl3 lib RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "yq" "4.16.2-0" --checksum f15327460a3006aae64e378e8a2753387882205418a8858fcb76aa9032a790be RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.1-4" --checksum c45ee409fbdf90bf18295323ba4242eeea060ad22c1a423e3a1d460d328942ee RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "render-template" "1.0.1-4" --checksum 9828603aa29cf7743a583f8e6214e474214775d3a4e841e5210fe8768d66a56c -RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "mongodb" "4.0.27-0" --checksum 95b7a05fa4c90f5483f7a93d6b937fdba16ae44b016e5e3b2db6a5b7130462c9 +RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "mongodb" "4.0.27-1" --checksum ad3d8fd8122ddf409cac416626351559ffb8709691ed82579d2b26de129c5580 RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-0" --checksum d177bc3da307f83d83ac8284be8062fc8b428e8f38a3b697876b5efc73ebf74f RUN chmod g+rwX /opt/bitnami COPY rootfs / RUN /opt/bitnami/scripts/mongodb/postunpack.sh ENV BITNAMI_APP_NAME="mongodb" \ - BITNAMI_IMAGE_VERSION="4.0.27-debian-9-r109" \ + BITNAMI_IMAGE_VERSION="4.0.27-debian-9-r111" \ PATH="/opt/bitnami/common/bin:/opt/bitnami/mongodb/bin:$PATH" EXPOSE 27017 diff --git a/bitnami/mongodb/4.0/debian-9/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/mongodb/4.0/debian-9/prebuildfs/opt/bitnami/.bitnami_components.json index b2e02432315a..99866b65c2fd 100644 --- a/bitnami/mongodb/4.0/debian-9/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/mongodb/4.0/debian-9/prebuildfs/opt/bitnami/.bitnami_components.json @@ -8,10 +8,10 @@ }, "mongodb": { "arch": "amd64", - "digest": "95b7a05fa4c90f5483f7a93d6b937fdba16ae44b016e5e3b2db6a5b7130462c9", + "digest": "ad3d8fd8122ddf409cac416626351559ffb8709691ed82579d2b26de129c5580", "distro": "debian-9", "type": "NAMI", - "version": "4.0.27-0" + "version": "4.0.27-1" }, "render-template": { "arch": "amd64", diff --git a/bitnami/mongodb/4.0/debian-9/rootfs/opt/bitnami/scripts/libmongodb.sh b/bitnami/mongodb/4.0/debian-9/rootfs/opt/bitnami/scripts/libmongodb.sh index d69fcf51ae18..d561a052f5a5 100644 --- a/bitnami/mongodb/4.0/debian-9/rootfs/opt/bitnami/scripts/libmongodb.sh +++ b/bitnami/mongodb/4.0/debian-9/rootfs/opt/bitnami/scripts/libmongodb.sh @@ -837,15 +837,16 @@ mongodb_is_secondary_node_pending() { mongodb_set_dwc + debug "Adding secondary node ${node}:${port}" result=$( mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" < m.name === '$node:$port' && m.stateStr === 'SECONDARY').length === 1 +EOF + ) + debug "$result" + + grep -q "true" <<<"$result" +} + +######################## +# Grant voting rights to secondary node +# Globals: +# MONGODB_* +# Arguments: +# $1 - node +# $2 - port +# Returns: +# Boolean +######################### +mongodb_configure_secondary_node_voting() { + local -r node="${1:?node is required}" + local -r port="${2:?port is required}" + + debug "Granting voting rights to the node" + local reconfig_cmd="rs.reconfigForPSASet(member, cfg)" + [[ "$(mongodb_get_version)" =~ ^4\.(0|2)\. ]] && reconfig_cmd="rs.reconfig(cfg)" + result=$( + mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" < m.host === '$node:$port') +cfg.members[member].priority = 1 +cfg.members[member].votes = 1 +$reconfig_cmd +EOF + ) + debug "$result" + + grep -q "\"ok\" : 1" <<<"$result" +} + ######################## # Get if hidden node is pending # Globals: @@ -871,6 +928,7 @@ mongodb_is_hidden_node_pending() { mongodb_set_dwc + debug "Adding hidden node ${node}:${port}" result=$( mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" </dev/null | grep 'shell version v' | sed 's/.* v//g' +} + ######################## # Run custom initialization scripts # Globals: diff --git a/bitnami/mongodb/README.md b/bitnami/mongodb/README.md index 835b07514fe7..88eeb62b78b6 100644 --- a/bitnami/mongodb/README.md +++ b/bitnami/mongodb/README.md @@ -51,7 +51,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`5.0`, `5.0-debian-10`, `5.0.5`, `5.0.5-debian-10-r26` (5.0/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/5.0.5-debian-10-r26/5.0/debian-10/Dockerfile) * [`4.4`, `4.4-debian-10`, `4.4.11`, `4.4.11-debian-10-r7`, `latest` (4.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.4.11-debian-10-r7/4.4/debian-10/Dockerfile) * [`4.2`, `4.2-debian-10`, `4.2.18`, `4.2.18-debian-10-r1` (4.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.2.18-debian-10-r1/4.2/debian-10/Dockerfile) -* [`4.0`, `4.0-debian-9`, `4.0.27`, `4.0.27-debian-9-r110` (4.0/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.0.27-debian-9-r110/4.0/debian-9/Dockerfile) +* [`4.0`, `4.0-debian-9`, `4.0.27`, `4.0.27-debian-9-r111` (4.0/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.0.27-debian-9-r111/4.0/debian-9/Dockerfile) Subscribe to project updates by watching the [bitnami/mongodb GitHub repo](https://github.com/bitnami/bitnami-docker-mongodb).