From 203fd36d976e5775a80d05668234778a2a21a84a Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Tue, 23 Nov 2021 15:41:33 +0100 Subject: [PATCH] avoid nilPointer when syncing connectionPooler --- pkg/cluster/connection_pooler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cluster/connection_pooler.go b/pkg/cluster/connection_pooler.go index 5bde71458..c5c55350f 100644 --- a/pkg/cluster/connection_pooler.go +++ b/pkg/cluster/connection_pooler.go @@ -712,7 +712,8 @@ func (c *Cluster) syncConnectionPooler(oldSpec, newSpec *acidv1.Postgresql, Look if (!needSync && len(masterChanges) <= 0 && len(replicaChanges) <= 0) && ((!needConnectionPooler(&newSpec.Spec) && (c.ConnectionPooler == nil || !needConnectionPooler(&oldSpec.Spec))) || (c.ConnectionPooler != nil && needConnectionPooler(&newSpec.Spec) && - (c.ConnectionPooler[Master].LookupFunction || c.ConnectionPooler[Replica].LookupFunction))) { + ((c.ConnectionPooler[Master] != nil && c.ConnectionPooler[Master].LookupFunction) || + (c.ConnectionPooler[Replica] != nil && c.ConnectionPooler[Replica].LookupFunction)))) { c.logger.Debugln("syncing pooler is not required") return nil, nil }