diff --git a/internal/controller/telemetry/controller_integration_test.go b/internal/controller/telemetry/controller_integration_test.go index 85033907..d8b2ab2e 100644 --- a/internal/controller/telemetry/controller_integration_test.go +++ b/internal/controller/telemetry/controller_integration_test.go @@ -28,6 +28,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/yaml" //+kubebuilder:scaffold:imports ) @@ -119,14 +120,14 @@ var _ = Describe("Telemetry controller integration test", func() { SubscriptionNamespaceSelectors: []metav1.LabelSelector{ { MatchLabels: map[string]string{ - "nsSelector": "tenant-1-ctrl", + "kubernetes.io/metadata.name": "tenant-1-ctrl", }, }, }, LogSourceNamespaceSelectors: []metav1.LabelSelector{ { MatchLabels: map[string]string{ - "nsSelector": "tenant-1-workload", + "kubernetes.io/metadata.name": "tenant-1-workload", }, }, }, @@ -145,14 +146,14 @@ var _ = Describe("Telemetry controller integration test", func() { SubscriptionNamespaceSelectors: []metav1.LabelSelector{ { MatchLabels: map[string]string{ - "nsSelector": "tenant-2-all", + "kubernetes.io/metadata.name": "tenant-2-all", }, }, }, LogSourceNamespaceSelectors: []metav1.LabelSelector{ { MatchLabels: map[string]string{ - "nsSelector": "tenant-2-all", + "kubernetes.io/metadata.name": "tenant-2-all", }, }, }, @@ -283,7 +284,15 @@ var _ = Describe("Telemetry controller integration test", func() { return err == nil }, timeout, interval).Should(BeTrue()) - Expect(createdOtelCollector.Spec.Config).To(Equal(exptectedOtelCollector.Spec.Config)) + expectedMap := map[string]any{} + err = yaml.Unmarshal([]byte(exptectedOtelCollector.Spec.Config), expectedMap) + Expect(err).NotTo(HaveOccurred()) + + createdMap := map[string]any{} + err = yaml.Unmarshal([]byte(createdOtelCollector.Spec.Config), createdMap) + Expect(err).NotTo(HaveOccurred()) + + Expect(createdMap).To(Equal(expectedMap)) }) }) diff --git a/internal/controller/telemetry/envtest_testdata/config.yaml b/internal/controller/telemetry/envtest_testdata/config.yaml index 7a7ae90f..af2875b4 100644 --- a/internal/controller/telemetry/envtest_testdata/config.yaml +++ b/internal/controller/telemetry/envtest_testdata/config.yaml @@ -100,9 +100,13 @@ processors: from: resource_attribute connectors: routing/tenant_tenant-1_subscriptions: - table: [] + table: + - statement: route() + pipelines: [logs/tenant_tenant-1_subscription_subscription-example-1] routing/tenant_tenant-2_subscriptions: - table: [] + table: + - statement: route() + pipelines: [logs/tenant_tenant-2_subscription_subscription-example-2] routing/tenants: table: - statement: 'route() where ' @@ -123,3 +127,11 @@ service: receivers: [routing/tenants] processors: [attributes/tenant_tenant-2] exporters: [routing/tenant_tenant-2_subscriptions] + logs/tenant_tenant-1_subscription_subscription-example-1: + receivers: [routing/tenant_tenant-1_subscriptions] + processors: [attributes/subscription_subscription-example-1] + exporters: [otlp/collector_otlp-test-output-1] + logs/tenant_tenant-2_subscription_subscription-example-2: + receivers: [routing/tenant_tenant-2_subscriptions] + processors: [attributes/subscription_subscription-example-2] + exporters: [otlp/collector_otlp-test-output-2] \ No newline at end of file