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:
parent
447a659d6d
commit
0095be0279
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue