-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix(postgres): fix pg_isready issue with empty listen_addresses #165
fix(postgres): fix pg_isready issue with empty listen_addresses #165
Conversation
This commit resolves the issue where `pg_isready` would fail when `socketDir` is set and `listen_addresses` is empty. `pg_isready` is now modified to leverage `socketDir` when it is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoudn't this be done at a level close to the option def? Maybe:
services-flake/nix/postgres/default.nix
Lines 182 to 187 in e4d8770
default = { | |
listen_addresses = config.listen_addresses; | |
port = config.port; | |
unix_socket_directories = config.socketDir; | |
hba_file = "${config.hbaConfFile}"; | |
}; |
(I haven't looked the whole code, so I might be missing something)
I doubt that is possible here, because then we would expect |
@johnhampton could you also add a basic test You can add the test here: https://github.com/juspay/services-flake/blob/main/nix/postgres/postgres_test.nix |
Test a postgres service with socketDir set and empty listen_addresses.
@shivaraj-bh done. |
@srid I'm not sure, I followed the code just above my change. services-flake/nix/postgres/default.nix Lines 317 to 322 in 0922b13
|
And primarily that is because the settings above ( I couldn’t find any documentation on the clients picking up configs from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks
This PR resolves the issue where
pg_isready
would fail whensocketDir
is set andlisten_addresses
is empty.pg_isready
is now modified to usesocketDir
when it is available.