mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 21:53:29 +02:00
Fix uninitialized ConnectionPool structure usage
It's being used quite early to setup a connection pool user, and if only enableConnectionPool specified, can be nil.
This commit is contained in:
@@ -863,6 +863,11 @@ func (c *Cluster) initSystemUsers() {
|
||||
// created by operator as a normal pgUser
|
||||
if c.needConnectionPool() {
|
||||
|
||||
// initialize empty connection pool if not done yet
|
||||
if c.Spec.ConnectionPool == nil {
|
||||
c.Spec.ConnectionPool = &acidv1.ConnectionPool{}
|
||||
}
|
||||
|
||||
username := c.Spec.ConnectionPool.User
|
||||
if username == "" {
|
||||
username = c.OpConfig.ConnectionPool.User
|
||||
|
||||
Reference in New Issue
Block a user