Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/postgresql] Updated libpostgresql.sh to specify a host to Postgres Commands #68236

Merged

Conversation

james-mchugh
Copy link
Contributor

@james-mchugh james-mchugh commented Jun 29, 2024

Description of the change

Updates the postgresql_start_bg and postgresql_execute_print_output functions in libpostgresql.sh to specify the loopback address as the host for psql and pg_isready commands.

Benefits

If a custom unix socket directory is specified in the Primary configuration, startup will fail as the psql and pg_isready commands do not look at the correct location for the Unix socket directory. This updates them to use the loopback host which should work regardless of where the unix socket file is stored, and it is also consistent with the behavior of the probes used by the Helm chart.

Being able to specify a custom Unix socket directory is useful, as the Bitnami Postgresql image provided by Iron Bank is built on top of the RHEL Universal Base Image and uses the RHEL Postgresql port. The RHEL Postgresql port defaults to storing Postgresql's unix socket under /run, which poses an issue as it is a common security measure to deploy containers with read-only root filesystems.

Possible drawbacks

None that I'm aware of. I've tested this in standalone and replication mode, and both appeared to work as expected.

Applicable issues

Additional information

There appears to be a separate bug here mentioned in #68027 where if the startup setup fails the first time, it will never be completed. When this happens, the Postgresql container will act as if it is healthy even though the authentication and databases have not been properly setup. This PR does not fix that issue.

@github-actions github-actions bot added postgresql triage Triage is needed labels Jun 29, 2024
@github-actions github-actions bot requested a review from carrodher June 29, 2024 17:22
@james-mchugh james-mchugh changed the title Updated libpostgresql.sh to specify the loopback address as the host … [bitnami/postgresql] Updated libpostgresql.sh to specify a host to Postgres Commands Jun 29, 2024
…for psql commands

Signed-off-by: James Riley McHugh <mchugh_james@bah.com>
@james-mchugh james-mchugh force-pushed the fix-postgresql-readiness-check branch from 16cd989 to 5095354 Compare June 29, 2024 17:23
@carrodher carrodher added verify Execute verification workflow for these changes in-progress labels Jul 1, 2024
@github-actions github-actions bot removed the triage Triage is needed label Jul 1, 2024
@github-actions github-actions bot removed the request for review from carrodher July 1, 2024 06:16
@github-actions github-actions bot requested a review from jotamartos July 1, 2024 06:16
@jotamartos
Copy link
Contributor

Thanks for taking the time to create this PR. Please let us test the changes and ensure this doesn't break the configuration of any solution in the catalog. Thanks

Copy link
Contributor

@jotamartos jotamartos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal tests succeeded. Thanks for your contribution

@jotamartos jotamartos merged commit 48700bc into bitnami:main Jul 3, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postgresql solved verify Execute verification workflow for these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bitnami/postgresql] Custom unix_socket_directories causes startup configuration to fail
3 participants