fix LookupFunction flag

This commit is contained in:
Felix Kunde 2021-08-25 17:49:15 +02:00
parent 54481d76af
commit 8a3b414cec
2 changed files with 3 additions and 3 deletions

View File

@ -760,11 +760,11 @@ func (c *Cluster) syncConnectionPooler(oldSpec, newSpec *acidv1.Postgresql, Look
// in between // in between
// in this case also do not forget to install lookup function // in this case also do not forget to install lookup function
if c.ConnectionPooler[role].LookupFunction { if !c.ConnectionPooler[role].LookupFunction {
if err = c.syncConnectionPoolerSchema(LookupFunction); err != nil { if err = c.syncConnectionPoolerSchema(LookupFunction); err != nil {
c.ConnectionPooler[role].LookupFunction = true
return NoSync, err return NoSync, err
} }
c.ConnectionPooler[role].LookupFunction = true
} }
if reason, err = c.syncConnectionPoolerWorker(oldSpec, newSpec, role); err != nil { if reason, err = c.syncConnectionPoolerWorker(oldSpec, newSpec, role); err != nil {

View File

@ -760,7 +760,7 @@ func (c *Cluster) syncDatabases() error {
if len(createDatabases) > 0 { if len(createDatabases) > 0 {
// create the pooler objects in new database if needed // create the pooler objects in new database if needed
if needConnectionPooler(&c.Spec) { if c.ConnectionPooler != nil && needConnectionPooler(&c.Spec) {
c.syncConnectionPoolerSchema(c.installLookupFunction) c.syncConnectionPoolerSchema(c.installLookupFunction)
} }
} }