Skip to content

Commit

Permalink
pre-start is no longer needed if we mount the certs in /etc/pki
Browse files Browse the repository at this point in the history
The problem with /var/lib/pgsql/data/userdata is if this is a new install,
initalizing the database will fail because the userdata directory is not
empty and it is expected to be empty.  Since the postgres configs are always
mounted on the pod we need the certs to be in a predictable location.
  • Loading branch information
bdunne committed Dec 12, 2022
1 parent be7c70f commit d365a53
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ RUN yum -y update postgresql-* && \

ADD container-assets/container-scripts /opt/manageiq/container-scripts/
ADD container-assets/on-start.sh ${APP_DATA}/src/postgresql-start/
ADD container-assets/pre-start.sh ${APP_DATA}/src/postgresql-pre-start/

# Loosen permission bits to avoid problems running container with arbitrary UID
RUN /usr/libexec/fix-permissions /var/lib/pgsql && \
Expand Down
2 changes: 1 addition & 1 deletion container-assets/on-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

psql --command "ALTER ROLE \"${POSTGRESQL_USER}\" SUPERUSER;"

if [ -f /opt/app-root/src/certificates/server.key ]; then
if [ -f /etc/pki/tls/private/server.key ]; then
sed -i 's/host\(\b.*\)/hostssl\1/g' /var/lib/pgsql/data/userdata/pg_hba.conf
fi
11 changes: 0 additions & 11 deletions container-assets/pre-start.sh

This file was deleted.

0 comments on commit d365a53

Please sign in to comment.