[bitnami/postgresql-repmgr] Release 18.0.0-debian-12-r12 (#87770)

Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
This commit is contained in:
Bitnami Bot 2025-10-17 12:16:38 +02:00 committed by GitHub
parent 0e6ec53cb5
commit f4b89d058a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 32 additions and 29 deletions

View File

@ -7,7 +7,7 @@ ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith"
ARG TARGETARCH
LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
org.opencontainers.image.created="2025-10-13T16:55:11Z" \
org.opencontainers.image.created="2025-10-17T10:05:17Z" \
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/postgresql-repmgr/README.md" \
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/postgresql-repmgr" \
@ -55,7 +55,7 @@ COPY rootfs /
RUN /opt/bitnami/scripts/postgresql-repmgr/postunpack.sh
ENV APP_VERSION="18.0.0" \
BITNAMI_APP_NAME="postgresql-repmgr" \
IMAGE_REVISION="11" \
IMAGE_REVISION="12" \
LANG="en_US.UTF-8" \
LANGUAGE="en_US:en" \
NSS_WRAPPER_LIB="/opt/bitnami/common/lib/libnss_wrapper.so" \

View File

@ -146,14 +146,6 @@ repmgr_validate() {
print_validation_error "The repmgr credentials are mandatory. Set the environment variables REPMGR_USERNAME and REPMGR_PASSWORD with the repmgr credentials."
fi
if [[ "$REPMGR_USE_PASSFILE" = "true" ]]; then
local -r psql_major_version="$(postgresql_get_major_version)"
if [[ "$psql_major_version" -le "9" ]]; then
warn "Variable REPMGR_USE_PASSFILE is not compatible with PostgreSQL ${psql_major_version}. It will be disabled."
export REPMGR_USE_PASSFILE="false"
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
@ -878,6 +870,7 @@ repmgr_initialize() {
repmgr_wait_primary_node || exit 1
repmgr_rewind
fi
# Run postgresql initialization skipping replication config
postgresql_initialize true
if ! repmgr_is_file_external "postgresql.conf"; then
@ -915,23 +908,14 @@ repmgr_initialize() {
debug "Skipping repmgr configuration..."
fi
elif [[ "$REPMGR_ROLE" = "standby" ]]; then
local -r psql_major_version="$(postgresql_get_major_version)"
POSTGRESQL_MASTER_PORT_NUMBER="$REPMGR_CURRENT_PRIMARY_PORT"
export POSTGRESQL_MASTER_PORT_NUMBER
POSTGRESQL_MASTER_HOST="$REPMGR_CURRENT_PRIMARY_HOST"
export POSTGRESQL_MASTER_HOST
postgresql_configure_recovery
postgresql_start_bg
repmgr_unregister_standby
repmgr_register_standby
if [[ "$psql_major_version" -lt "12" ]]; then
info "Check if primary running..."
repmgr_wait_primary_node
repmgr_standby_follow
fi
elif [[ "$REPMGR_ROLE" = "witness" ]]; then
postgresql_start_bg
repmgr_create_repmgr_user

View File

@ -106,6 +106,7 @@ postgresql_env_vars=(
POSTGRESQL_AUTOCTL_MONITOR_HOST
POSTGRESQL_AUTOCTL_HOSTNAME
REPMGR_DATA_DIR
REPMGR_SKIP_SETUP
REPMGR_NODE_ID
REPMGR_NODE_ID_START_SEED
REPMGR_NODE_NAME
@ -431,6 +432,7 @@ export REPMGR_DATA_DIR="${REPMGR_DATA_DIR:-${REPMGR_VOLUME_DIR}/repmgr/data}"
export REPMGR_PID_FILE="${REPMGR_TMP_DIR}/repmgr.pid"
# Settings (Replication Manager)
export REPMGR_SKIP_SETUP="${REPMGR_SKIP_SETUP:-no}"
export REPMGR_NODE_ID="${REPMGR_NODE_ID:-}"
export REPMGR_NODE_ID_START_SEED="${REPMGR_NODE_ID_START_SEED:-1000}"
export REPMGR_NODE_NAME="${REPMGR_NODE_NAME:-$(hostname)}"

View File

@ -18,7 +18,6 @@ for dir in "$POSTGRESQL_INITSCRIPTS_DIR" "$POSTGRESQL_TMP_DIR" "$POSTGRESQL_LOG_
chmod -R g+rwX "$dir"
done
# Copying events handlers
mv /events "$REPMGR_EVENTS_DIR"
chmod +x "$REPMGR_EVENTS_DIR"/router.sh "$REPMGR_EVENTS_DIR"/execs/*sh "$REPMGR_EVENTS_DIR"/execs/includes/*sh
@ -29,4 +28,3 @@ ln -sf /dev/stdout "$POSTGRESQL_LOG_FILE"
# Copy all initially generated configuration files to the default directory
# (this is to avoid breaking when entrypoint is being overridden)
cp -r "${POSTGRESQL_CONF_DIR}/"* "$POSTGRESQL_DEFAULT_CONF_DIR"

View File

@ -23,7 +23,6 @@ readonly repmgr_cmd=$(command -v repmgrd)
postgresql_start_bg true
info "** Starting repmgrd **"
# TODO: properly test running the container as root
if am_i_root; then
exec_as_user "$POSTGRESQL_DAEMON_USER" "$repmgr_cmd" "${repmgr_flags[@]}"
else

View File

@ -29,10 +29,29 @@ eval "$(repmgr_set_role)"
trap "postgresql_stop" EXIT
# Ensure 'daemon' user exists when running as 'root'
am_i_root && ensure_user_exists "$POSTGRESQL_DAEMON_USER" --group "$POSTGRESQL_DAEMON_GROUP"
# Prepare PostgreSQL default configuration
repmgr_postgresql_configuration
# Prepare repmgr configuration
repmgr_generate_repmgr_config
# Initialize PostgreSQL & repmgr
export POSTGRESQL_USE_CUSTOM_PGHBA_INITIALIZATION="yes"
repmgr_initialize
if is_boolean_yes "$REPMGR_SKIP_SETUP"; then
info "Skipping preparing configuration files..."
if [[ "$REPMGR_ROLE" = "standby" ]]; then
repmgr_wait_primary_node || exit 1
repmgr_rewind
POSTGRESQL_MASTER_PORT_NUMBER="$REPMGR_CURRENT_PRIMARY_PORT"
export POSTGRESQL_MASTER_PORT_NUMBER
POSTGRESQL_MASTER_HOST="$REPMGR_CURRENT_PRIMARY_HOST"
export POSTGRESQL_MASTER_HOST
postgresql_configure_recovery
postgresql_start_bg
repmgr_unregister_standby
repmgr_register_standby
fi
# This fixes an issue if a PID was left over during the setup
rm -f "$REPMGR_PID_FILE"
else
# Prepare PostgreSQL default configuration
repmgr_postgresql_configuration
# Prepare repmgr configuration
repmgr_generate_repmgr_config
# Initialize PostgreSQL & repmgr
export POSTGRESQL_USE_CUSTOM_PGHBA_INITIALIZATION="yes"
repmgr_initialize
fi

View File

@ -635,6 +635,7 @@ Refer to [issues/27124](https://github.com/bitnami/containers/issues/27124) for
| `POSTGRESQL_AUTOCTL_MONITOR_HOST` | Hostname for the monitor component | `monitor` |
| `POSTGRESQL_AUTOCTL_HOSTNAME` | Hostname by which postgres is reachable | `$(hostname --fqdn)` |
| `REPMGR_DATA_DIR` | Replication Manager data directory | `${REPMGR_VOLUME_DIR}/repmgr/data` |
| `REPMGR_SKIP_SETUP` | Skip Replication manager (and PostgreSQL) setup. | `no` |
| `REPMGR_NODE_ID` | Replication Manager node identifier | `nil` |
| `REPMGR_NODE_ID_START_SEED` | Replication Manager node identifier start seed | `1000` |
| `REPMGR_NODE_NAME` | Replication Manager node name | `$(hostname)` |