From c8d89f9c6505a0f1680fbbec00f0573b897a3593 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Fri, 1 Oct 2021 18:50:40 +0200 Subject: [PATCH] reflect code review --- pkg/apis/zalando.org/v1alpha1/register.go | 4 +--- pkg/cluster/cluster.go | 2 +- pkg/cluster/streams.go | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/apis/zalando.org/v1alpha1/register.go b/pkg/apis/zalando.org/v1alpha1/register.go index 07732ae53..0136a82ec 100644 --- a/pkg/apis/zalando.org/v1alpha1/register.go +++ b/pkg/apis/zalando.org/v1alpha1/register.go @@ -15,9 +15,7 @@ const ( var ( schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme applies all the stored functions to the scheme. A non-nil error - // indicates that one function failed and the attempt was abandoned. - AddToScheme = schemeBuilder.AddToScheme + AddToScheme = schemeBuilder.AddToScheme ) func init() { diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 195bfba27..1281dc377 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -362,7 +362,7 @@ func (c *Cluster) Create() error { c.createConnectionPooler(c.installLookupFunction) if err = c.syncStreams(); err != nil { - return fmt.Errorf("could not create streams: %v", err) + c.logger.Errorf("could not create streams: %v", err) } return nil diff --git a/pkg/cluster/streams.go b/pkg/cluster/streams.go index 07c94f473..4ba0558a9 100644 --- a/pkg/cluster/streams.go +++ b/pkg/cluster/streams.go @@ -79,7 +79,7 @@ func (c *Cluster) syncPostgresConfig() error { } if len(slots) > 0 { - c.logger.Debugf("setting wal level to 'logical' in Postgres configuration") + c.logger.Debugf("setting wal level to 'logical' in Postgres configuration to allow for decoding changes") for slotName, slot := range slots { c.logger.Debugf("creating logical replication slot %q in database %q", slotName, slot["database"]) } @@ -90,7 +90,7 @@ func (c *Cluster) syncPostgresConfig() error { pods, err := c.listPods() if err != nil || len(pods) == 0 { - return err + c.logger.Warnf("could not list pods of the statefulset: %v", err) } for i, pod := range pods { podName := util.NameFromMeta(pods[i].ObjectMeta) @@ -135,6 +135,8 @@ func (c *Cluster) generateFabricEventStream() *zalandov1alpha1.FabricEventStream Name: c.Name, Namespace: c.Namespace, Annotations: c.AnnotationsToPropagate(c.annotationsSet(nil)), + // make cluster StatefulSet the owner (like with connection pooler objects) + OwnerReferences: c.ownerReferences(), }, Spec: zalandov1alpha1.FabricEventStreamSpec{ ApplicationId: "",