From 6734a7a3f892e48381a5548f118274d5d6df2001 Mon Sep 17 00:00:00 2001 From: miya-masa Date: Tue, 25 Jul 2023 04:44:36 +0000 Subject: [PATCH] feat(*): support TLS in redis checker. --- checks/redis/check.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checks/redis/check.go b/checks/redis/check.go index 86bcb2f..8c181cd 100644 --- a/checks/redis/check.go +++ b/checks/redis/check.go @@ -20,9 +20,11 @@ type Config struct { func New(config Config) func(ctx context.Context) error { // support all DSN formats (for backward compatibility) - with and w/out schema and path part: // - redis://localhost:1234/ + // - rediss://localhost:1234/ // - localhost:1234 + redisDSN := config.DSN - if !strings.HasPrefix(redisDSN, "redis://") { + if !strings.HasPrefix(redisDSN, "redis://") && !strings.HasPrefix(redisDSN, "rediss://") { redisDSN = fmt.Sprintf("redis://%s", redisDSN) } redisOptions, _ := redis.ParseURL(redisDSN)