Skip to content

Commit

Permalink
fix: stop using openssl for container healthchecks (#4181)
Browse files Browse the repository at this point in the history
Dragonfly responds to ascii based requests to tls port with:
`-ERR Bad TLS header, double check if you enabled TLS for your client.`

Therefore, it is possible to test now both tls and non-tls ports with a plain-text PING.
Fixes #4171

Also, blacklist the bloom-filter test that Dragonfly does not support yet.

Signed-off-by: Roman Gershman <[email protected]>
  • Loading branch information
romange committed Nov 25, 2024
1 parent 379557b commit e4208e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/fakeredis/test/test_stack/test_bloomfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_create_cf(r: redis.Redis):
assert r.topk().reserve("topk", 5, 100, 5, 0.9)


@pytest.mark.unsupported_server_types("dragonfly")
def test_bf_reserve(r: redis.Redis):
assert r.bf().reserve("bloom", 0.01, 1000)
assert r.bf().reserve("bloom_ns", 0.01, 1000, noScale=True)
Expand Down
8 changes: 1 addition & 7 deletions tools/docker/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ if [ -z "$HEALTHCHECK_PORT" ]; then
PORT=$(echo $DF_NET | grep -oE ':[0-9]+' | cut -c2- | tail -n 1)
fi

# If we're running with TLS enabled, utilise OpenSSL for the check
if [ -f "/etc/dragonfly/tls/ca.crt" ]
then
_healthcheck="openssl s_client -connect ${HOST}:${PORT} -CAfile /etc/dragonfly/tls/ca.crt -quiet -no_ign_eof"
else
_healthcheck="nc -q1 $HOST $PORT"
fi
_healthcheck="nc -q1 $HOST $PORT"

echo PING | ${_healthcheck}

Expand Down

0 comments on commit e4208e9

Please sign in to comment.