name FES like the Postgres cluster

This commit is contained in:
Felix Kunde 2021-08-20 12:51:40 +02:00
parent 54257b8249
commit 6120ef7da4
4 changed files with 5 additions and 7 deletions

View File

@ -479,8 +479,8 @@ Those parameters are grouped under the `tls` top-level key.
This sections enables change data capture (CDC) streams e.g. into Zalandos
distributed event broker [Nakadi](https://nakadi.io/). Parameters grouped
under the `streams` top-level key will be used by the operator to create a
CRD for Zalando's internal CDC operator. Each stream can have the following
properties:
CRD for Zalando's internal CDC operator named like the Postgres cluster.
Each stream object can have the following properties:
* **streamType**
Defines the sink. Either `nakadi`, `sqs` or `wal` (which is just plain wal

View File

@ -131,7 +131,7 @@ func (c *Cluster) generateFabricEventStream() *zalandov1alpha1.FabricEventStream
return &zalandov1alpha1.FabricEventStream{
ObjectMeta: metav1.ObjectMeta{
Name: c.Name + constants.FESsuffix,
Name: c.Name,
Namespace: c.Namespace,
Annotations: c.AnnotationsToPropagate(c.annotationsSet(nil)),
},
@ -239,7 +239,7 @@ func (c *Cluster) syncStreams() error {
return fmt.Errorf("could not update Postgres config for event streaming: %v", err)
}
effectiveStreams, err := c.KubeClient.FabricEventStreamsGetter.FabricEventStreams(c.Namespace).Get(context.TODO(), c.Name+constants.FESsuffix, metav1.GetOptions{})
effectiveStreams, err := c.KubeClient.FabricEventStreamsGetter.FabricEventStreams(c.Namespace).Get(context.TODO(), c.Name, metav1.GetOptions{})
if err != nil {
if !k8sutil.ResourceNotFound(err) {
return fmt.Errorf("error during reading of event streams: %v", err)

View File

@ -10,7 +10,6 @@ import (
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
fakezalandov1alpha1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/fake"
"github.com/zalando/postgres-operator/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -93,7 +92,7 @@ func TestGenerateFabricEventStream(t *testing.T) {
err := cluster.syncStreams()
assert.NoError(t, err)
streamCRD, err := cluster.KubeClient.FabricEventStreams(namespace).Get(context.TODO(), cluster.Name+constants.FESsuffix, metav1.GetOptions{})
streamCRD, err := cluster.KubeClient.FabricEventStreams(namespace).Get(context.TODO(), cluster.Name, metav1.GetOptions{})
assert.NoError(t, err)
result := cluster.generateFabricEventStream()

View File

@ -2,7 +2,6 @@ package constants
// PostgreSQL specific constants
const (
FESsuffix = "-event-streams"
EventStreamSourcePGType = "PostgresLogicalReplication"
EventStreamSourceSlotPrefix = "fes_"
EventStreamSourceAuthType = "DatabaseAuthenticationSecret"