From e0f865ad8f8c050335ecce946cf06fc0a9cf4a6d Mon Sep 17 00:00:00 2001 From: Hank Donnay Date: Tue, 25 Jan 2022 12:21:31 -0600 Subject: [PATCH] config: add deprecation notice to `max_conn_pool` This is a weird wart that may not mean anything in a future where we support other database backends. This adds documentation noting what to do instead. Signed-off-by: Hank Donnay --- config/matcher.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/config/matcher.go b/config/matcher.go index c3861a5899..793b44712e 100644 --- a/config/matcher.go +++ b/config/matcher.go @@ -34,9 +34,14 @@ type Matcher struct { UpdateRetention int `yaml:"update_retention" json:"update_retention"` // A positive integer // - // Clair allows for a custom connection pool size. - // This number will directly set how many active sql - // connections are allowed concurrently. + // Clair allows for a custom connection pool size. This number will + // directly set how many active sql connections are allowed concurrently. + // + // Deprecated: Pool size should be set through the ConnString member. + // Currently, Clair only uses the "pgxpool" package to connect to the + // database, so see + // https://pkg.go.dev/github.com/jackc/pgx/v4/pgxpool#ParseConfig for more + // information. MaxConnPool int `yaml:"max_conn_pool" json:"max_conn_pool"` // CacheAge controls how long clients should be hinted to cache responses // for. @@ -116,6 +121,12 @@ func (m *Matcher) lint() (ws []Warning, err error) { msg: "update garbage collection is off", }) } + if m.MaxConnPool != 0 { + ws = append(ws, Warning{ + path: ".max_conn_pool", + msg: "this parameter will be ignored in a future release", + }) + } return ws, nil }