name FES like the Postgres cluster
This commit is contained in:
parent
54257b8249
commit
6120ef7da4
|
|
@ -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 Zalando’s
|
This sections enables change data capture (CDC) streams e.g. into Zalando’s
|
||||||
distributed event broker [Nakadi](https://nakadi.io/). Parameters grouped
|
distributed event broker [Nakadi](https://nakadi.io/). Parameters grouped
|
||||||
under the `streams` top-level key will be used by the operator to create a
|
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
|
CRD for Zalando's internal CDC operator named like the Postgres cluster.
|
||||||
properties:
|
Each stream object can have the following properties:
|
||||||
|
|
||||||
* **streamType**
|
* **streamType**
|
||||||
Defines the sink. Either `nakadi`, `sqs` or `wal` (which is just plain wal
|
Defines the sink. Either `nakadi`, `sqs` or `wal` (which is just plain wal
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ func (c *Cluster) generateFabricEventStream() *zalandov1alpha1.FabricEventStream
|
||||||
|
|
||||||
return &zalandov1alpha1.FabricEventStream{
|
return &zalandov1alpha1.FabricEventStream{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: c.Name + constants.FESsuffix,
|
Name: c.Name,
|
||||||
Namespace: c.Namespace,
|
Namespace: c.Namespace,
|
||||||
Annotations: c.AnnotationsToPropagate(c.annotationsSet(nil)),
|
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)
|
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 err != nil {
|
||||||
if !k8sutil.ResourceNotFound(err) {
|
if !k8sutil.ResourceNotFound(err) {
|
||||||
return fmt.Errorf("error during reading of event streams: %v", err)
|
return fmt.Errorf("error during reading of event streams: %v", err)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import (
|
||||||
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
|
acidv1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
|
||||||
fakezalandov1alpha1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/fake"
|
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/config"
|
||||||
"github.com/zalando/postgres-operator/pkg/util/constants"
|
|
||||||
"github.com/zalando/postgres-operator/pkg/util/k8sutil"
|
"github.com/zalando/postgres-operator/pkg/util/k8sutil"
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
@ -93,7 +92,7 @@ func TestGenerateFabricEventStream(t *testing.T) {
|
||||||
err := cluster.syncStreams()
|
err := cluster.syncStreams()
|
||||||
assert.NoError(t, err)
|
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)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
result := cluster.generateFabricEventStream()
|
result := cluster.generateFabricEventStream()
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package constants
|
||||||
|
|
||||||
// PostgreSQL specific constants
|
// PostgreSQL specific constants
|
||||||
const (
|
const (
|
||||||
FESsuffix = "-event-streams"
|
|
||||||
EventStreamSourcePGType = "PostgresLogicalReplication"
|
EventStreamSourcePGType = "PostgresLogicalReplication"
|
||||||
EventStreamSourceSlotPrefix = "fes_"
|
EventStreamSourceSlotPrefix = "fes_"
|
||||||
EventStreamSourceAuthType = "DatabaseAuthenticationSecret"
|
EventStreamSourceAuthType = "DatabaseAuthenticationSecret"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue