Skip to content

Commit

Permalink
Fix Bitnami repmgr
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurianti committed Apr 24, 2024
1 parent 7f1a5f5 commit 81825c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
5 changes: 1 addition & 4 deletions bitnami/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,4 @@ FROM timescale AS timescale-postgresql-repmgr
ENTRYPOINT [ "/opt/bitnami/scripts/timescale/timescaledb-bitnami-entrypoint.sh" ]
CMD [ "/opt/bitnami/scripts/postgresql-repmgr/run.sh" ]

FROM timescale-${PG_BASE_IMAGE}
ARG PG_BASE_IMAGE
ENV PG_BASE_IMAGE=${PG_BASE_IMAGE}
ENV PG_ORIGINAL_ENTRYPOINT_PATH="/opt/bitnami/scripts/${PG_BASE_IMAGE}"
FROM timescale-${PG_BASE_IMAGE}
4 changes: 2 additions & 2 deletions bitnami/timescaledb-bitnami-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export POSTGRESQL_SHARED_PRELOAD_LIBRARIES

# Timescale tuning breaks standby nodes on repmgr clusters, so we disable it
# by default
if [ "$PG_BASE_IMAGE" == "postgresql-repmgr" ]
if [ "$BITNAMI_APP_NAME" == "postgresql-repmgr" ]
then
export NO_TS_TUNE=true
fi

# Fall through to the original entrypoint. Note that we use exec here because
# this wrapper script shouldn't change PID 1 of the container.
exec "${PG_ORIGINAL_ENTRYPOINT_PATH}/entrypoint.sh" "$@"
exec "/opt/bitnami/scripts/${BITNAMI_APP_NAME}/entrypoint.sh" "$@"
11 changes: 6 additions & 5 deletions docker-entrypoint-initdb.d/000_install_timescaledb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ create_sql=`mktemp`
# Checks to support bitnami image with same scripts so they stay in sync
if [ ! -z "${BITNAMI_APP_NAME:-}" ]; then
if [ -z "${POSTGRES_USER:-}" ]; then
POSTGRES_USER=postgres
fi

if [ -z "${POSTGRESQL_PASSWORD:-}" ]; then
POSTGRESQL_PASSWORD=${POSTGRESQL_POSTGRES_PASSWORD}
POSTGRES_USER=${POSTGRESQL_USERNAME}
fi

if [ -z "${POSTGRES_DB:-}" ]; then
Expand All @@ -21,6 +17,11 @@ if [ ! -z "${BITNAMI_APP_NAME:-}" ]; then
fi
fi

if [ "${BITNAMI_APP_NAME:-}" == "postgresql-repmgr" ]; then
POSTGRES_USER="postgres"
POSTGRESQL_PASSWORD=${POSTGRESQL_POSTGRES_PASSWORD}
fi

if [ -z "${POSTGRESQL_CONF_DIR:-}" ]; then
POSTGRESQL_CONF_DIR=${PGDATA}
fi
Expand Down

0 comments on commit 81825c3

Please sign in to comment.