Skip to content

Commit

Permalink
Added fix to patroni_wait.sh to support SSL secured patroni.
Browse files Browse the repository at this point in the history
This is quickfix to get it working.
  • Loading branch information
Mika Salminen committed Jan 2, 2025
1 parent ad8b8a4 commit 997ebdc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion postgres-appliance/scripts/patroni_wait.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ do
*)
echo "Unknown option: $1"
exit 1

;;
esac
shift
Expand All @@ -62,7 +63,13 @@ done
if [ $# -gt 0 ]; then
[ -n "$TIMEOUT" ] && CUTOFF=$(($(date +%s)+TIMEOUT))

while [ "$(curl -so /dev/null -w '%{http_code}' "http://localhost:8008/$ROLE")" != "200" ]; do
if [ -z "$RESTAPI_CONNECT_ADDRESS" ]; then
ADDRESS="localhost"
else
ADDRESS="$RESTAPI_CONNECT_ADDRESS"
fi

while [ "$(curl --cert $SSL_RESTAPI_CERTIFICATE_FILE --key $SSL_PRIVATE_KEY_FILE --cacert $SSL_RESTAPI_CA_FILE -so /dev/null -w '%{http_code}' "https://$ADDRESS:8008/$ROLE")" != "200" ]; do
[ -n "$TIMEOUT" ] && [ $CUTOFF -le "$(date +%s)" ] && exit 2
sleep "$INTERVAL"
done
Expand Down

0 comments on commit 997ebdc

Please sign in to comment.