From f62f45212c33b6e25621c83a8e924a5d8d6eb92b Mon Sep 17 00:00:00 2001 From: Leo Li Date: Wed, 26 Jul 2023 16:39:41 -0400 Subject: [PATCH 1/5] Add some initial attempt code --- test/rekt/eventtype_test.go | 50 +++++++++++++++++ test/rekt/features/eventtype/feature.go | 73 +++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 test/rekt/eventtype_test.go create mode 100644 test/rekt/features/eventtype/feature.go diff --git a/test/rekt/eventtype_test.go b/test/rekt/eventtype_test.go new file mode 100644 index 00000000000..8af9ff40218 --- /dev/null +++ b/test/rekt/eventtype_test.go @@ -0,0 +1,50 @@ +//go:build e2e +// +build e2e + +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rekt + +import ( + "testing" + "time" + + "knative.dev/pkg/system" + _ "knative.dev/pkg/system/testing" + "knative.dev/reconciler-test/pkg/environment" + "knative.dev/reconciler-test/pkg/k8s" + "knative.dev/reconciler-test/pkg/knative" + "knative.dev/reconciler-test/pkg/tracing" + + "knative.dev/eventing/test/rekt/features/broker" +) + +func TestEventTypeWithBrokerAsReference(t *testing.T) { + t.Parallel() + + ctx, env := global.Environment( + knative.WithKnativeNamespace(system.Namespace()), + knative.WithLoggingConfig, + knative.WithTracingConfig, + k8s.WithEventListener, + environment.Managed(t), + tracing.WithGatherer(t), + environment.WithPollTimings(5*time.Second, 4*time.Minute), + ) + + env.TestSet(ctx, t, broker.ManyTriggers()) +} diff --git a/test/rekt/features/eventtype/feature.go b/test/rekt/features/eventtype/feature.go new file mode 100644 index 00000000000..731570ceb51 --- /dev/null +++ b/test/rekt/features/eventtype/feature.go @@ -0,0 +1,73 @@ +/* +Copyright 2022 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package eventtype + +import ( + cloudevents "github.com/cloudevents/sdk-go/v2" + "github.com/google/uuid" + duckv1 "knative.dev/eventing/pkg/apis/duck/v1" + "knative.dev/eventing/test/rekt/resources/broker" + "knative.dev/eventing/test/rekt/resources/trigger" + "knative.dev/pkg/ptr" + "knative.dev/reconciler-test/pkg/eventshub" + "knative.dev/reconciler-test/pkg/feature" + "knative.dev/reconciler-test/pkg/manifest" + "knative.dev/reconciler-test/pkg/resources/service" +) + +func eventTypeWithBrokerAsReference(retryNum int32, dropNum uint) *feature.Feature { + f := feature.NewFeatureNamed("Broker reply with a bad status code to the first n events") + + source := feature.MakeRandomK8sName("source") + sink := feature.MakeRandomK8sName("sink") + via := feature.MakeRandomK8sName("via") + + eventSource := "source2" + eventType := "type2" + eventBody := `{"msg":"DropN"}` + event := cloudevents.NewEvent() + event.SetID(uuid.New().String()) + event.SetType(eventType) + event.SetSource(eventSource) + event.SetData(cloudevents.ApplicationJSON, []byte(eventBody)) + + //Install the broker + brokerName := feature.MakeRandomK8sName("broker") + exp := duckv1.BackoffPolicyLinear + brokerConfig := append(broker.WithEnvConfig(), broker.WithRetry(retryNum, &exp, ptr.String("PT1S"))) + + f.Setup("install broker", broker.Install(brokerName, brokerConfig...)) + f.Requirement("broker is ready", broker.IsReady(brokerName)) + f.Requirement("broker is addressable", broker.IsAddressable(brokerName)) + + f.Setup("install sink", eventshub.Install(sink, eventshub.StartReceiver)) + + // Point the Trigger subscriber to the sink svc. + cfg := []manifest.CfgFn{trigger.WithSubscriber(service.AsKReference(sink), "")} + + // Install the trigger + f.Setup("install trigger", trigger.Install(via, brokerName, cfg...)) + f.Setup("trigger goes ready", trigger.IsReady(via)) + + f.Requirement("install source", eventshub.Install( + source, + eventshub.StartSenderToResource(broker.GVR(), brokerName), + eventshub.InputEvent(event), + )) + + return f +} From 16a3d37f11d4fe2f5441149060959d99f984cecf Mon Sep 17 00:00:00 2001 From: Leo Li Date: Thu, 27 Jul 2023 16:09:03 -0400 Subject: [PATCH 2/5] Add some comments, waiting for the reply from the upstream to the question: how to retrieve all the eventType in the event registry by using go code --- test/rekt/eventtype_test.go | 4 +--- test/rekt/features/eventtype/feature.go | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/rekt/eventtype_test.go b/test/rekt/eventtype_test.go index 8af9ff40218..e28e9afa224 100644 --- a/test/rekt/eventtype_test.go +++ b/test/rekt/eventtype_test.go @@ -29,8 +29,6 @@ import ( "knative.dev/reconciler-test/pkg/k8s" "knative.dev/reconciler-test/pkg/knative" "knative.dev/reconciler-test/pkg/tracing" - - "knative.dev/eventing/test/rekt/features/broker" ) func TestEventTypeWithBrokerAsReference(t *testing.T) { @@ -46,5 +44,5 @@ func TestEventTypeWithBrokerAsReference(t *testing.T) { environment.WithPollTimings(5*time.Second, 4*time.Minute), ) - env.TestSet(ctx, t, broker.ManyTriggers()) + env.TestSet(ctx, t, eventtype.eventTypeWithBrokerAsReference()) } diff --git a/test/rekt/features/eventtype/feature.go b/test/rekt/features/eventtype/feature.go index 731570ceb51..0f69641df4d 100644 --- a/test/rekt/features/eventtype/feature.go +++ b/test/rekt/features/eventtype/feature.go @@ -69,5 +69,8 @@ func eventTypeWithBrokerAsReference(retryNum int32, dropNum uint) *feature.Featu eventshub.InputEvent(event), )) + // The eventType should be already auto-created. We then need to pop up the eventType in the event registry. + // We need to validate the reference of the eventType is pointing to the broker. + return f } From 66e74e3bf7c7d3629014d32f508c465826ce0031 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Fri, 28 Jul 2023 17:24:04 -0400 Subject: [PATCH 3/5] Add the AssertReferenceKind function --- test/rekt/eventtype_test.go | 1 + test/rekt/features/eventtype/feature.go | 4 ++++ test/rekt/resources/eventtype/eventtype.go | 16 ++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/test/rekt/eventtype_test.go b/test/rekt/eventtype_test.go index e28e9afa224..adf61348bd5 100644 --- a/test/rekt/eventtype_test.go +++ b/test/rekt/eventtype_test.go @@ -23,6 +23,7 @@ import ( "testing" "time" + "eventing/test/rekt/features/eventtype" "knative.dev/pkg/system" _ "knative.dev/pkg/system/testing" "knative.dev/reconciler-test/pkg/environment" diff --git a/test/rekt/features/eventtype/feature.go b/test/rekt/features/eventtype/feature.go index 0f69641df4d..a20159f8318 100644 --- a/test/rekt/features/eventtype/feature.go +++ b/test/rekt/features/eventtype/feature.go @@ -21,6 +21,7 @@ import ( "github.com/google/uuid" duckv1 "knative.dev/eventing/pkg/apis/duck/v1" "knative.dev/eventing/test/rekt/resources/broker" + "knative.dev/eventing/test/rekt/resources/eventtype" "knative.dev/eventing/test/rekt/resources/trigger" "knative.dev/pkg/ptr" "knative.dev/reconciler-test/pkg/eventshub" @@ -71,6 +72,9 @@ func eventTypeWithBrokerAsReference(retryNum int32, dropNum uint) *feature.Featu // The eventType should be already auto-created. We then need to pop up the eventType in the event registry. // We need to validate the reference of the eventType is pointing to the broker. + f.Stable("ApiServerSource as event source"). + Must("ApiServerSource test eventtypes match", + eventtype.WaitForEventType(eventtype.AssertReferenceMatch("InMemoryChannel"))) return f } diff --git a/test/rekt/resources/eventtype/eventtype.go b/test/rekt/resources/eventtype/eventtype.go index 88c641fb74c..23241c657ef 100644 --- a/test/rekt/resources/eventtype/eventtype.go +++ b/test/rekt/resources/eventtype/eventtype.go @@ -75,3 +75,19 @@ func AssertPresent(expectedCeTypes sets.String) EventType { } } + +func AssertReferenceMatch(expectedCeType string) EventType { + return EventType{ + Name: "test eventtypes's reference match or not", + EventTypes: func(etl eventingv1beta2.EventTypeList) (bool, error) { + eventtypesCount := 0 + for _, et := range etl.Items { + if expectedCeType == et.Spec.Reference.Kind { + eventtypesCount++ + } + } + return (eventtypesCount == len(etl.Items)), nil + }, + } + +} From 03dcdddba9fd109e6f6a4c4fde35377eb781a011 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Mon, 31 Jul 2023 10:52:19 -0400 Subject: [PATCH 4/5] fix the public function issue --- test/rekt/eventtype_test.go | 9 ++- test/rekt/features/eventtype/feature.go | 93 +++++++++++-------------- 2 files changed, 44 insertions(+), 58 deletions(-) diff --git a/test/rekt/eventtype_test.go b/test/rekt/eventtype_test.go index adf61348bd5..8c41ea940a3 100644 --- a/test/rekt/eventtype_test.go +++ b/test/rekt/eventtype_test.go @@ -20,16 +20,15 @@ limitations under the License. package rekt import ( - "testing" - "time" - - "eventing/test/rekt/features/eventtype" + "knative.dev/eventing/test/rekt/features/eventtype" "knative.dev/pkg/system" _ "knative.dev/pkg/system/testing" "knative.dev/reconciler-test/pkg/environment" "knative.dev/reconciler-test/pkg/k8s" "knative.dev/reconciler-test/pkg/knative" "knative.dev/reconciler-test/pkg/tracing" + "testing" + "time" ) func TestEventTypeWithBrokerAsReference(t *testing.T) { @@ -45,5 +44,5 @@ func TestEventTypeWithBrokerAsReference(t *testing.T) { environment.WithPollTimings(5*time.Second, 4*time.Minute), ) - env.TestSet(ctx, t, eventtype.eventTypeWithBrokerAsReference()) + env.TestSet(ctx, t, eventtype.EventTypeWithBrokerAsReference()) } diff --git a/test/rekt/features/eventtype/feature.go b/test/rekt/features/eventtype/feature.go index a20159f8318..fa22bea464e 100644 --- a/test/rekt/features/eventtype/feature.go +++ b/test/rekt/features/eventtype/feature.go @@ -17,64 +17,51 @@ limitations under the License. package eventtype import ( - cloudevents "github.com/cloudevents/sdk-go/v2" - "github.com/google/uuid" - duckv1 "knative.dev/eventing/pkg/apis/duck/v1" - "knative.dev/eventing/test/rekt/resources/broker" - "knative.dev/eventing/test/rekt/resources/eventtype" - "knative.dev/eventing/test/rekt/resources/trigger" - "knative.dev/pkg/ptr" - "knative.dev/reconciler-test/pkg/eventshub" "knative.dev/reconciler-test/pkg/feature" - "knative.dev/reconciler-test/pkg/manifest" - "knative.dev/reconciler-test/pkg/resources/service" ) -func eventTypeWithBrokerAsReference(retryNum int32, dropNum uint) *feature.Feature { +func EventTypeWithBrokerAsReference() *feature.Feature { f := feature.NewFeatureNamed("Broker reply with a bad status code to the first n events") - source := feature.MakeRandomK8sName("source") - sink := feature.MakeRandomK8sName("sink") - via := feature.MakeRandomK8sName("via") - - eventSource := "source2" - eventType := "type2" - eventBody := `{"msg":"DropN"}` - event := cloudevents.NewEvent() - event.SetID(uuid.New().String()) - event.SetType(eventType) - event.SetSource(eventSource) - event.SetData(cloudevents.ApplicationJSON, []byte(eventBody)) - - //Install the broker - brokerName := feature.MakeRandomK8sName("broker") - exp := duckv1.BackoffPolicyLinear - brokerConfig := append(broker.WithEnvConfig(), broker.WithRetry(retryNum, &exp, ptr.String("PT1S"))) - - f.Setup("install broker", broker.Install(brokerName, brokerConfig...)) - f.Requirement("broker is ready", broker.IsReady(brokerName)) - f.Requirement("broker is addressable", broker.IsAddressable(brokerName)) - - f.Setup("install sink", eventshub.Install(sink, eventshub.StartReceiver)) - - // Point the Trigger subscriber to the sink svc. - cfg := []manifest.CfgFn{trigger.WithSubscriber(service.AsKReference(sink), "")} - - // Install the trigger - f.Setup("install trigger", trigger.Install(via, brokerName, cfg...)) - f.Setup("trigger goes ready", trigger.IsReady(via)) - - f.Requirement("install source", eventshub.Install( - source, - eventshub.StartSenderToResource(broker.GVR(), brokerName), - eventshub.InputEvent(event), - )) - - // The eventType should be already auto-created. We then need to pop up the eventType in the event registry. - // We need to validate the reference of the eventType is pointing to the broker. - f.Stable("ApiServerSource as event source"). - Must("ApiServerSource test eventtypes match", - eventtype.WaitForEventType(eventtype.AssertReferenceMatch("InMemoryChannel"))) + //source := feature.MakeRandomK8sName("source") + //sink := feature.MakeRandomK8sName("sink") + //via := feature.MakeRandomK8sName("via") + // + //eventSource := "source2" + //eventType := "type2" + //eventBody := `{"msg":"DropN"}` + //event := cloudevents.NewEvent() + //event.SetID(uuid.New().String()) + //event.SetType(eventType) + //event.SetSource(eventSource) + //event.SetData(cloudevents.ApplicationJSON, []byte(eventBody)) + // + ////Install the broker + //brokerName := feature.MakeRandomK8sName("broker") + // + //f.Requirement("broker is ready", broker.IsReady(brokerName)) + //f.Requirement("broker is addressable", broker.IsAddressable(brokerName)) + // + //f.Setup("install sink", eventshub.Install(sink, eventshub.StartReceiver)) + // + //// Point the Trigger subscriber to the sink svc. + //cfg := []manifest.CfgFn{trigger.WithSubscriber(service.AsKReference(sink), "")} + // + //// Install the trigger + //f.Setup("install trigger", trigger.Install(via, brokerName, cfg...)) + //f.Setup("trigger goes ready", trigger.IsReady(via)) + // + //f.Requirement("install source", eventshub.Install( + // source, + // eventshub.StartSenderToResource(broker.GVR(), brokerName), + // eventshub.InputEvent(event), + //)) + // + //// The eventType should be already auto-created. We then need to pop up the eventType in the event registry. + //// We need to validate the reference of the eventType is pointing to the broker. + //f.Stable("ApiServerSource as event source"). + // Must("ApiServerSource test eventtypes match", + // eventtype.WaitForEventType(eventtype.AssertReferenceMatch("InMemoryChannel"))) return f } From 185342149a27b8a32c63e85f2a8307a531403d76 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Mon, 31 Jul 2023 16:08:19 -0400 Subject: [PATCH 5/5] Add some loggers for debugging purposes --- test/rekt/eventtype_test.go | 2 +- test/rekt/features/eventtype/feature.go | 90 ++++++++++++++++++++-- test/rekt/resources/eventtype/eventtype.go | 13 ++++ 3 files changed, 99 insertions(+), 6 deletions(-) diff --git a/test/rekt/eventtype_test.go b/test/rekt/eventtype_test.go index 8c41ea940a3..5fd6969c8a1 100644 --- a/test/rekt/eventtype_test.go +++ b/test/rekt/eventtype_test.go @@ -44,5 +44,5 @@ func TestEventTypeWithBrokerAsReference(t *testing.T) { environment.WithPollTimings(5*time.Second, 4*time.Minute), ) - env.TestSet(ctx, t, eventtype.EventTypeWithBrokerAsReference()) + env.Test(ctx, t, eventtype.EventTypeWithBrokerAsReference()) } diff --git a/test/rekt/features/eventtype/feature.go b/test/rekt/features/eventtype/feature.go index fa22bea464e..798c70dc37f 100644 --- a/test/rekt/features/eventtype/feature.go +++ b/test/rekt/features/eventtype/feature.go @@ -17,12 +17,39 @@ limitations under the License. package eventtype import ( + "context" + "github.com/cloudevents/sdk-go/v2/test" + rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/apimachinery/pkg/util/sets" + "knative.dev/eventing/pkg/apis/sources" + v1 "knative.dev/eventing/pkg/apis/sources/v1" + "knative.dev/eventing/test/rekt/resources/account_role" + "knative.dev/eventing/test/rekt/resources/apiserversource" + "knative.dev/eventing/test/rekt/resources/broker" + "knative.dev/eventing/test/rekt/resources/eventtype" + "knative.dev/eventing/test/rekt/resources/trigger" + duckv1 "knative.dev/pkg/apis/duck/v1" + "knative.dev/reconciler-test/pkg/eventshub" + eventasssert "knative.dev/reconciler-test/pkg/eventshub/assert" "knative.dev/reconciler-test/pkg/feature" + "knative.dev/reconciler-test/pkg/manifest" + "knative.dev/reconciler-test/pkg/resources/service" ) -func EventTypeWithBrokerAsReference() *feature.Feature { - f := feature.NewFeatureNamed("Broker reply with a bad status code to the first n events") +func setupAccountAndRoleForPods(sacmName string) feature.StepFn { + return account_role.Install(sacmName, + account_role.WithRole(sacmName+"-clusterrole"), + account_role.WithRules(rbacv1.PolicyRule{ + APIGroups: []string{""}, + Resources: []string{"events", "pods"}, + Verbs: []string{"get", "list", "watch"}, + }), + ) +} +func EventTypeWithBrokerAsReference() *feature.Feature { + //f := feature.NewFeatureNamed("Broker reply with a bad status code to the first n events") + // //source := feature.MakeRandomK8sName("source") //sink := feature.MakeRandomK8sName("sink") //via := feature.MakeRandomK8sName("via") @@ -39,6 +66,7 @@ func EventTypeWithBrokerAsReference() *feature.Feature { ////Install the broker //brokerName := feature.MakeRandomK8sName("broker") // + //f.Setup("install broker", broker.Install(brokerName)) //f.Requirement("broker is ready", broker.IsReady(brokerName)) //f.Requirement("broker is addressable", broker.IsAddressable(brokerName)) // @@ -57,11 +85,63 @@ func EventTypeWithBrokerAsReference() *feature.Feature { // eventshub.InputEvent(event), //)) // + //f.Stable("containersource as event source"). + // Must("delivers events", + // assert.OnStore(sink). + // Match(assert.MatchKind(eventshub.EventReceived)). + // MatchEvent(test.HasType("type3")). + // AtLeast(1), + // ).Must("ApiServerSource test eventtypes match", + // eventtype.WaitForEventType(eventtype.AssertReferenceMatch("InMemoryChannel"))) + // //// The eventType should be already auto-created. We then need to pop up the eventType in the event registry. //// We need to validate the reference of the eventType is pointing to the broker. - //f.Stable("ApiServerSource as event source"). - // Must("ApiServerSource test eventtypes match", - // eventtype.WaitForEventType(eventtype.AssertReferenceMatch("InMemoryChannel"))) + + source := feature.MakeRandomK8sName("source") + sink := feature.MakeRandomK8sName("sink") + via := feature.MakeRandomK8sName("via") + + f := new(feature.Feature) + + //Install the broker + brokerName := feature.MakeRandomK8sName("broker") + f.Setup("install broker", broker.Install(brokerName, broker.WithEnvConfig()...)) + f.Setup("broker is ready", broker.IsReady(brokerName)) + f.Setup("broker is addressable", broker.IsAddressable(brokerName)) + f.Setup("install sink", eventshub.Install(sink, eventshub.StartReceiver)) + f.Setup("install trigger", trigger.Install(via, brokerName, trigger.WithSubscriber(service.AsKReference(sink), ""))) + f.Setup("trigger goes ready", trigger.IsReady(via)) + + sacmName := feature.MakeRandomK8sName("apiserversource") + f.Setup("Create Service Account for ApiServerSource with RBAC for v1.Event resources", + setupAccountAndRoleForPods(sacmName)) + + f.Requirement("install apiserversource", func(ctx context.Context, t feature.T) { + brokeruri, err := broker.Address(ctx, brokerName) + if err != nil { + t.Error("failed to get address of broker", err) + } + cfg := []manifest.CfgFn{ + apiserversource.WithServiceAccountName(sacmName), + apiserversource.WithEventMode(v1.ResourceMode), + apiserversource.WithSink(&duckv1.Destination{URI: brokeruri.URL, CACerts: brokeruri.CACerts}), + apiserversource.WithResources(v1.APIVersionKindSelector{ + APIVersion: "v1", + Kind: "Event", + }), + } + apiserversource.Install(source, cfg...)(ctx, t) + }) + f.Requirement("ApiServerSource goes ready", apiserversource.IsReady(source)) + + expectedCeTypes := sets.NewString(sources.ApiServerSourceEventReferenceModeTypes...) + + f.Stable("ApiServerSource as event source"). + Must("delivers events on broker with URI", + eventasssert.OnStore(sink).MatchEvent(test.HasType("dev.knative.apiserver.resource.update")).AtLeast(1)). + Must("ApiServerSource test eventtypes match", + eventtype.WaitForEventType(eventtype.AssertPresent(expectedCeTypes))) return f + } diff --git a/test/rekt/resources/eventtype/eventtype.go b/test/rekt/resources/eventtype/eventtype.go index 23241c657ef..3c264653069 100644 --- a/test/rekt/resources/eventtype/eventtype.go +++ b/test/rekt/resources/eventtype/eventtype.go @@ -18,6 +18,7 @@ package eventtype import ( "context" + "fmt" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -51,6 +52,9 @@ func WaitForEventType(eventtype EventType, timing ...time.Duration) feature.Step return false, nil } lastEtl = etl + fmt.Println("eventtype.Name", eventtype.EventTypes) + fmt.Printf("eventtypehaha %#v\n", eventtype.EventTypes) + fmt.Printf("eventtype %+v\n", eventtype) return eventtype.EventTypes(*etl) }) if err != nil { @@ -64,12 +68,15 @@ func AssertPresent(expectedCeTypes sets.String) EventType { return EventType{ Name: "test eventtypes match or not", EventTypes: func(etl eventingv1beta2.EventTypeList) (bool, error) { + fmt.Println("expectedCeTypes", expectedCeTypes) eventtypesCount := 0 for _, et := range etl.Items { + fmt.Println("et.Spec.Type", et.Spec.Type) if expectedCeTypes.Has(et.Spec.Type) { eventtypesCount++ } } + fmt.Println("eventtypesCount", eventtypesCount) return (eventtypesCount == len(etl.Items)), nil }, } @@ -77,15 +84,21 @@ func AssertPresent(expectedCeTypes sets.String) EventType { } func AssertReferenceMatch(expectedCeType string) EventType { + + fmt.Println("haha") + fmt.Println(expectedCeType) + return EventType{ Name: "test eventtypes's reference match or not", EventTypes: func(etl eventingv1beta2.EventTypeList) (bool, error) { eventtypesCount := 0 for _, et := range etl.Items { + fmt.Println("et.Spec.Reference.Kind", et.Spec.Reference.Kind) if expectedCeType == et.Spec.Reference.Kind { eventtypesCount++ } } + fmt.Println("eventtypesCount", eventtypesCount) return (eventtypesCount == len(etl.Items)), nil }, }