From 8a3b414cec750a6a07e88cd8e8e344b38a2aa0ee Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Wed, 25 Aug 2021 17:49:15 +0200 Subject: [PATCH] fix LookupFunction flag --- pkg/cluster/connection_pooler.go | 4 ++-- pkg/cluster/sync.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/connection_pooler.go b/pkg/cluster/connection_pooler.go index d8780d61f..23b3cb9c6 100644 --- a/pkg/cluster/connection_pooler.go +++ b/pkg/cluster/connection_pooler.go @@ -760,11 +760,11 @@ func (c *Cluster) syncConnectionPooler(oldSpec, newSpec *acidv1.Postgresql, Look // in between // 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 { - c.ConnectionPooler[role].LookupFunction = true return NoSync, err } + c.ConnectionPooler[role].LookupFunction = true } if reason, err = c.syncConnectionPoolerWorker(oldSpec, newSpec, role); err != nil { diff --git a/pkg/cluster/sync.go b/pkg/cluster/sync.go index e1136db5c..d18aa4656 100644 --- a/pkg/cluster/sync.go +++ b/pkg/cluster/sync.go @@ -760,7 +760,7 @@ func (c *Cluster) syncDatabases() error { if len(createDatabases) > 0 { // create the pooler objects in new database if needed - if needConnectionPooler(&c.Spec) { + if c.ConnectionPooler != nil && needConnectionPooler(&c.Spec) { c.syncConnectionPoolerSchema(c.installLookupFunction) } }