From 72f56b8cf66fd45eb088b8f99e5dbd7b68941c43 Mon Sep 17 00:00:00 2001 From: Sebastian Saletnik Date: Thu, 19 Sep 2024 21:02:57 +0200 Subject: [PATCH] Patroni works with empty conn_str --- internal/sources/resolver.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/sources/resolver.go b/internal/sources/resolver.go index 7eb3d859b..967fe06a3 100644 --- a/internal/sources/resolver.go +++ b/internal/sources/resolver.go @@ -160,6 +160,7 @@ func getEtcdClusterMembers(s Source) ([]PatroniClusterMember, error) { if err != nil { return ret, err } + defer c.Close() ctx, cancel := context.WithTimeoutCause(context.Background(), 5*time.Second, errors.New("etcd client timeout")) defer cancel() @@ -302,6 +303,7 @@ func ResolveDatabasesFromPatroni(ce Source) ([]*MonitoredDatabase, error) { logger.Errorf("Could not contact Patroni member [%s:%s]: %v", ce.Name, m.Scope, err) continue } + connURL.Scheme = "postgresql" connURL.Host = host + ":" + port connURL.Path = "template1" c, err := db.New(context.TODO(), connURL.String())