Skip to content

Commit

Permalink
config: add deprecation notice to max_conn_pool
Browse files Browse the repository at this point in the history
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 <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Jan 25, 2022
1 parent d215220 commit e0f865a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions config/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}

0 comments on commit e0f865a

Please sign in to comment.