Skip to content

Commit

Permalink
fix: orchestration topics
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Jan 8, 2024
1 parent dd2ff80 commit fcf7849
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package controllers

import (
"fmt"
"github.com/formancehq/operator/v2/api/v1beta1"
. "github.com/formancehq/operator/v2/internal/core"
"github.com/formancehq/operator/v2/internal/resources/authclients"
Expand Down Expand Up @@ -131,7 +132,7 @@ func (r *OrchestrationController) createDeployment(ctx Context, stack *v1beta1.S
Env("TEMPORAL_NAMESPACE", orchestration.Spec.Temporal.Namespace),
Env("WORKER", "true"),
Env("TOPICS", strings.Join(Map(eventPublishers, func(from unstructured.Unstructured) string {
return from.GetName()
return fmt.Sprintf("%s-%s", stack.Name, strings.ToLower(from.GetKind()))
}), " ")),
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package controllers_test

import (
"fmt"
"github.com/formancehq/operator/v2/api/v1beta1"
. "github.com/formancehq/operator/v2/internal/controllers/testing"
"github.com/formancehq/operator/v2/internal/core"
core "github.com/formancehq/operator/v2/internal/core"
"github.com/google/uuid"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -92,6 +93,10 @@ var _ = Describe("OrchestrationController", func() {
return LoadResource(stack.Name, "orchestration", deployment)
}).Should(Succeed())
Expect(deployment).To(BeControlledBy(orchestration))
Expect(deployment.Spec.Template.Spec.Containers[0].Env).To(ContainElements(
core.Env("WORKER", "true"),
core.Env("TOPICS", fmt.Sprintf("%s-ledger", stack.Name)),
))
})
It("Should create a new HTTPAPI object", func() {
httpService := &v1beta1.HTTPAPI{}
Expand Down

0 comments on commit fcf7849

Please sign in to comment.