From 58f1b90a4f90d3aaf52aafcdc15f2aac8f5ef620 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Tue, 17 Jan 2023 12:30:16 +0100 Subject: [PATCH] [bitnami/postgresql-repmgr] Release 11.18.0-debian-11-r23 (#20541) Signed-off-by: Bitnami Containers Signed-off-by: Bitnami Containers --- .../postgresql-repmgr/11/debian-11/Dockerfile | 2 +- .../rootfs/opt/bitnami/scripts/librepmgr.sh | 65 ++++++++++++++++++- .../opt/bitnami/scripts/postgresql-env.sh | 2 + bitnami/postgresql-repmgr/README.md | 1 + 4 files changed, 67 insertions(+), 3 deletions(-) diff --git a/bitnami/postgresql-repmgr/11/debian-11/Dockerfile b/bitnami/postgresql-repmgr/11/debian-11/Dockerfile index 853164fedb49..0f6f542db472 100644 --- a/bitnami/postgresql-repmgr/11/debian-11/Dockerfile +++ b/bitnami/postgresql-repmgr/11/debian-11/Dockerfile @@ -5,7 +5,7 @@ ARG TARGETARCH LABEL org.opencontainers.image.authors="https://bitnami.com/contact" \ org.opencontainers.image.description="Application packaged by Bitnami" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="11.18.0-debian-11-r22" \ + org.opencontainers.image.ref.name="11.18.0-debian-11-r23" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/postgresql-repmgr" \ org.opencontainers.image.title="postgresql-repmgr" \ org.opencontainers.image.vendor="VMware, Inc." \ diff --git a/bitnami/postgresql-repmgr/11/debian-11/rootfs/opt/bitnami/scripts/librepmgr.sh b/bitnami/postgresql-repmgr/11/debian-11/rootfs/opt/bitnami/scripts/librepmgr.sh index 149143c117d3..e10fb1ad6a63 100644 --- a/bitnami/postgresql-repmgr/11/debian-11/rootfs/opt/bitnami/scripts/librepmgr.sh +++ b/bitnami/postgresql-repmgr/11/debian-11/rootfs/opt/bitnami/scripts/librepmgr.sh @@ -117,6 +117,10 @@ repmgr_validate() { fi fi + if [[ -z "$REPMGR_NODE_TYPE" ]] || ! [[ "$REPMGR_NODE_TYPE" =~ ^(data|witness)$ ]]; then + print_validation_error "Set the environment variable REPMGR_NODE_TYPE to 'data' or 'witness'." + fi + if ! is_yes_no_value "$REPMGR_PGHBA_TRUST_ALL"; then print_validation_error "The allowed values for REPMGR_PGHBA_TRUST_ALL are: yes or no." fi @@ -260,9 +264,17 @@ repmgr_set_role() { primary_host=${primary_node[0]} primary_port=${primary_node[1]:-$REPMGR_PRIMARY_PORT} - if [[ -z "$primary_host" ]]; then + if [[ "$REPMGR_NODE_TYPE" = "data" ]]; then + if [[ -z "$primary_host" ]]; then info "There are no nodes with primary role. Assuming the primary role..." role="primary" + else + info "Node configured as standby" + role="standby" + fi + else + info "Node configured as witness" + role="witness" fi cat <