From 6501836579638f1835211ea3e836f235998a69be Mon Sep 17 00:00:00 2001 From: Philipp Eberle Date: Mon, 22 Nov 2021 19:30:48 +0100 Subject: [PATCH] prevent nil pointer in operator by setting the enableConnectionPooler option in the custom ressource --- api/v1/postgres_types.go | 5 +++++ go.mod | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/v1/postgres_types.go b/api/v1/postgres_types.go index d0267d0c..0ab75d3f 100644 --- a/api/v1/postgres_types.go +++ b/api/v1/postgres_types.go @@ -26,6 +26,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/yaml" + "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -460,6 +461,10 @@ func (p *Postgres) ToUnstructuredZalandoPostgresql(z *zalando.Postgresql, c *cor z.Spec.Patroni.SynchronousMode = true z.Spec.Patroni.SynchronousModeStrict = false + // required with image ermajn/postgres-operator:v1.6.0-20-g1cc71663-dirty + // see https://github.com/fi-ts/postgreslet/issues/293 + z.Spec.EnableConnectionPooler = pointer.Bool(false) + prefix := alphaNumericRegExp.ReplaceAllString(string(p.Spec.Tenant), "") prefix = strings.ToLower(prefix) databaseName := prefix + "db01" diff --git a/go.mod b/go.mod index ec626eb4..3b343a92 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/go-logr/logr v0.4.0 - github.com/google/uuid v1.2.0 // indirect + github.com/google/uuid v1.2.0 github.com/metal-stack/firewall-controller v1.0.9 github.com/metal-stack/v v1.0.3 github.com/onsi/ginkgo v1.16.4 @@ -17,5 +17,6 @@ require ( k8s.io/apiextensions-apiserver v0.21.3 k8s.io/apimachinery v0.21.3 k8s.io/client-go v0.21.3 + k8s.io/utils v0.0.0-20210527160623-6fdb442a123b sigs.k8s.io/controller-runtime v0.9.2 )