Skip to content

Commit

Permalink
feat(operator): add brokertopicconsumer for orchestration (#1287)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag authored Feb 27, 2024
1 parent 506f9a4 commit a01caa4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ type Orchestration struct {
Status OrchestrationStatus `json:"status,omitempty"`
}

func (in *Orchestration) isEventPublisher() {}

func (in *Orchestration) IsEE() bool {
return false
}
Expand Down Expand Up @@ -103,3 +105,5 @@ type OrchestrationList struct {
func init() {
SchemeBuilder.Register(&Orchestration{}, &OrchestrationList{})
}

var _ EventPublisher = (*Orchestration)(nil)
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ func CreateOrUpdateOnAllServices(ctx core.Context, consumer interface {

ret := make([]*v1beta1.BrokerTopicConsumer, 0)
for _, service := range services {
if service.GetKind() == consumer.GetObjectKind().GroupVersionKind().Kind {
continue
}
brokerTopicConsumer, err := Create(ctx, strings.ToLower(service.GetKind()), consumer)
if err != nil {
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/formancehq/operator/api/formance.com/v1beta1"
. "github.com/formancehq/operator/internal/core"
"github.com/formancehq/operator/internal/resources/brokertopicconsumers"
"github.com/formancehq/operator/internal/resources/brokertopics"
"github.com/formancehq/operator/internal/resources/databases"
"github.com/formancehq/operator/internal/resources/gatewayhttpapis"
"github.com/formancehq/operator/internal/resources/jobs"
Expand Down Expand Up @@ -97,6 +98,7 @@ func init() {
WithWatchDependency[*v1beta1.Orchestration](&v1beta1.Auth{}),
WithWatchDependency[*v1beta1.Orchestration](&v1beta1.Payments{}),
WithWatchDependency[*v1beta1.Orchestration](&v1beta1.Wallets{}),
brokertopics.Watch[*v1beta1.Orchestration]("orchestration"),
databases.Watch[*v1beta1.Orchestration](),
),
)
Expand Down

0 comments on commit a01caa4

Please sign in to comment.