Merge pull request #3213 from agentydragon/both-protos

Check both http and https in DockerHealthcheck
This commit is contained in:
zadam 2022-10-22 14:00:45 +02:00 committed by GitHub
commit c5435009d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,13 @@
#!/bin/sh #!/bin/sh
if wget --spider -S "127.0.0.1:8080/api/health-check" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
exit 0 # Try connecting to /api/health-check using both http and https.
else # TODO: we should only be connecting with the actual protocol that is enabled
exit 1 # TODO: this assumes we use the default port 8080
fi
for proto in http https; do
if wget --spider -S "$proto://127.0.0.1:8080/api/health-check" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
exit 0
fi
done
exit 1