diff --git a/PROJECT b/PROJECT index a0826064..71755207 100644 --- a/PROJECT +++ b/PROJECT @@ -5,6 +5,7 @@ domain: kyma-project.io layout: - go.kubebuilder.io/v4 +multigroup: true projectName: eventing-manager repo: github.com/kyma-project/eventing-manager resources: @@ -15,6 +16,6 @@ resources: domain: kyma-project.io group: operator kind: Eventing - path: github.com/kyma-project/eventing-manager/api/v1alpha1 + path: github.com/kyma-project/eventing-manager/api/batch/v1alpha1 version: v1alpha1 version: "3" diff --git a/api/v1alpha1/eventing_types.go b/api/batch/v1alpha1/eventing_types.go similarity index 100% rename from api/v1alpha1/eventing_types.go rename to api/batch/v1alpha1/eventing_types.go diff --git a/api/v1alpha1/eventing_types_test.go b/api/batch/v1alpha1/eventing_types_test.go similarity index 100% rename from api/v1alpha1/eventing_types_test.go rename to api/batch/v1alpha1/eventing_types_test.go diff --git a/api/v1alpha1/groupversion_info.go b/api/batch/v1alpha1/groupversion_info.go similarity index 100% rename from api/v1alpha1/groupversion_info.go rename to api/batch/v1alpha1/groupversion_info.go diff --git a/api/v1alpha1/status.go b/api/batch/v1alpha1/status.go similarity index 100% rename from api/v1alpha1/status.go rename to api/batch/v1alpha1/status.go diff --git a/api/v1alpha1/status_test.go b/api/batch/v1alpha1/status_test.go similarity index 100% rename from api/v1alpha1/status_test.go rename to api/batch/v1alpha1/status_test.go diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/batch/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from api/v1alpha1/zz_generated.deepcopy.go rename to api/batch/v1alpha1/zz_generated.deepcopy.go diff --git a/cmd/main.go b/cmd/main.go index d289baa0..295c44a8 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -22,6 +22,8 @@ import ( "log" "os" + eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/batch/eventing" + istiopeerauthentication "github.com/kyma-project/eventing-manager/pkg/istio/peerauthentication" "github.com/go-logr/zapr" @@ -36,7 +38,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/eventing" "github.com/kyma-project/eventing-manager/options" backendmetrics "github.com/kyma-project/eventing-manager/pkg/backend/metrics" "github.com/kyma-project/eventing-manager/pkg/env" @@ -57,7 +58,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/metrics/server" "sigs.k8s.io/controller-runtime/pkg/webhook" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" //+kubebuilder:scaffold:imports ) diff --git a/docs/user/02-configuration.md b/docs/user/02-configuration.md index da4db46f..a3303cd1 100644 --- a/docs/user/02-configuration.md +++ b/docs/user/02-configuration.md @@ -28,46 +28,49 @@ Use the following sample CRs as guidance. Each can be applied immediately when y **Spec:** -| Parameter | Type | Description | -|----------------------------------------------------------|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **annotations** | map\[string\]string | Annotations allows to add annotations to resources. | -| **backend** (required) | object | Backend defines the active backend used by Eventing. | -| **backend.​config** | object | Config defines configuration for eventing backend. | -| **backend.​config.​domain** | string | Domain defines the cluster public domain used to configure the EventMesh Subscriptions and their corresponding ApiRules. | -| **backend.​config.​eventMeshSecret** | string | EventMeshSecret defines the namespaced name of K8s Secret containing EventMesh credentials. The format of name is "namespace/name". | -| **backend.​config.​eventTypePrefix** | string | | -| **backend.​config.​natsMaxMsgsPerTopic** | integer | NATSMaxMsgsPerTopic limits how many messages in the NATS stream to retain per subject. | -| **backend.​config.​natsStreamMaxSize** | \{integer or string\} | NATSStreamMaxSize defines the maximum storage size for stream data. | -| **backend.​config.​natsStreamReplicas** | integer | NATSStreamReplicas defines the number of replicas for stream. | -| **backend.​config.​natsStreamStorageType** | string | NATSStreamStorageType defines the storage type for stream data. | -| **backend.​type** (required) | string | Type defines which backend to use. The value is either `EventMesh`, or `NATS`. | -| **labels** | map\[string\]string | Labels allows to add Labels to resources. | -| **logging** | object | Logging defines the log level for eventing-manager. | -| **logging.​logLevel** | string | LogLevel defines the log level. | -| **publisher** | object | Publisher defines the configurations for eventing-publisher-proxy. | -| **publisher.​replicas** | object | Replicas defines the scaling min/max for eventing-publisher-proxy. | -| **publisher.​replicas.​max** | integer | Max defines maximum number of replicas. | -| **publisher.​replicas.​min** | integer | Min defines minimum number of replicas. | -| **publisher.​resources** | object | Resources defines resources for eventing-publisher-proxy. | -| **publisher.​resources.​claims** | \[\]object | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. | -| **publisher.​resources.​claims.​name** (required) | string | Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. | -| **publisher.​resources.​limits** | map\[string\]\{integer or string\} | Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | +| Parameter | Type | Description | +| ---- | ----------- | ---- | +| **annotations** | map\[string\]string | Annotations allows to add annotations to resources. | +| **backend** (required) | object | Backend defines the active backend used by Eventing. | +| **backend.​config** | object | Config defines configuration for eventing backend. | +| **backend.​config.​domain** | string | Domain defines the cluster public domain used to configure the EventMesh Subscriptions and their corresponding ApiRules. | +| **backend.​config.​eventMeshSecret** | string | EventMeshSecret defines the namespaced name of K8s Secret containing EventMesh credentials. The format of name is "namespace/name". | +| **backend.​config.​eventTypePrefix** | string | | +| **backend.​config.​natsMaxMsgsPerTopic** | integer | NATSMaxMsgsPerTopic limits how many messages in the NATS stream to retain per subject. | +| **backend.​config.​natsStreamMaxSize** | \{integer or string\} | NATSStreamMaxSize defines the maximum storage size for stream data. | +| **backend.​config.​natsStreamReplicas** | integer | NATSStreamReplicas defines the number of replicas for stream. | +| **backend.​config.​natsStreamStorageType** | string | NATSStreamStorageType defines the storage type for stream data. | +| **backend.​type** (required) | string | Type defines which backend to use. The value is either `EventMesh`, or `NATS`. | +| **labels** | map\[string\]string | Labels allows to add Labels to resources. | +| **logging** | object | Logging defines the log level for eventing-manager. | +| **logging.​logLevel** | string | LogLevel defines the log level. | +| **publisher** | object | Publisher defines the configurations for eventing-publisher-proxy. | +| **publisher.​replicas** | object | Replicas defines the scaling min/max for eventing-publisher-proxy. | +| **publisher.​replicas.​max** | integer | Max defines maximum number of replicas. | +| **publisher.​replicas.​min** | integer | Min defines minimum number of replicas. | +| **publisher.​resources** | object | Resources defines resources for eventing-publisher-proxy. | +| **publisher.​resources.​claims** | \[\]object | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. + This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. + This field is immutable. It can only be set for containers. | +| **publisher.​resources.​claims.​name** (required) | string | Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. | +| **publisher.​resources.​limits** | map\[string\]\{integer or string\} | Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | | **publisher.​resources.​requests** | map\[string\]\{integer or string\} | Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | **Status:** -| Parameter | Type | Description | -|------------------------------------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **activeBackend** (required) | string | | -| **conditions** | \[\]object | Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` | -| // other fields } | | | -| **conditions.​lastTransitionTime** (required) | string | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. | -| **conditions.​message** (required) | string | message is a human readable message indicating details about the transition. This may be an empty string. | -| **conditions.​observedGeneration** | integer | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. | -| **conditions.​reason** (required) | string | reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. | -| **conditions.​status** (required) | string | status of the condition, one of `True`, `False`, `Unknown`. | -| **conditions.​type** (required) | string | type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) | -| **specHash** (required) | integer | | -| **state** (required) | string | | +| Parameter | Type | Description | +| ---- | ----------- | ---- | +| **activeBackend** (required) | string | | +| **conditions** | \[\]object | Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, + type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + // other fields } | +| **conditions.​lastTransitionTime** (required) | string | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. | +| **conditions.​message** (required) | string | message is a human readable message indicating details about the transition. This may be an empty string. | +| **conditions.​observedGeneration** | integer | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. | +| **conditions.​reason** (required) | string | reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. | +| **conditions.​status** (required) | string | status of the condition, one of True, False, Unknown. | +| **conditions.​type** (required) | string | type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) | +| **specHash** (required) | integer | | +| **state** (required) | string | | diff --git a/hack/e2e/cleanup/cleanup_test.go b/hack/e2e/cleanup/cleanup_test.go index 779ce23b..190f1e53 100644 --- a/hack/e2e/cleanup/cleanup_test.go +++ b/hack/e2e/cleanup/cleanup_test.go @@ -17,7 +17,7 @@ import ( k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/hack/e2e/common/testenvironment" "github.com/kyma-project/eventing-manager/pkg/eventing" diff --git a/hack/e2e/common/fixtures/fixtures.go b/hack/e2e/common/fixtures/fixtures.go index c520920e..119fb2a8 100644 --- a/hack/e2e/common/fixtures/fixtures.go +++ b/hack/e2e/common/fixtures/fixtures.go @@ -12,7 +12,7 @@ import ( "github.com/kyma-project/eventing-manager/hack/e2e/common/eventing" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/hack/e2e/common/k8s.go b/hack/e2e/common/k8s.go index e25be2a3..1ec1b1b5 100644 --- a/hack/e2e/common/k8s.go +++ b/hack/e2e/common/k8s.go @@ -9,7 +9,7 @@ import ( ecv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ecv1alpha2 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha2" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" diff --git a/hack/e2e/common/testenvironment/test_environment.go b/hack/e2e/common/testenvironment/test_environment.go index 508abff5..9a0eefb0 100644 --- a/hack/e2e/common/testenvironment/test_environment.go +++ b/hack/e2e/common/testenvironment/test_environment.go @@ -15,7 +15,7 @@ import ( cloudevents "github.com/cloudevents/sdk-go/v2" "github.com/cloudevents/sdk-go/v2/binding" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" ecv1alpha2 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha2" "go.uber.org/zap" diff --git a/hack/e2e/env/env.go b/hack/e2e/env/env.go index bc1d05d3..0838a0db 100644 --- a/hack/e2e/env/env.go +++ b/hack/e2e/env/env.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/kelseyhightower/envconfig" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" ) // E2EConfig represents the environment config for the end-to-end tests for eventing-manager. diff --git a/hack/e2e/setup/setup_test.go b/hack/e2e/setup/setup_test.go index d30387a4..1212c24f 100644 --- a/hack/e2e/setup/setup_test.go +++ b/hack/e2e/setup/setup_test.go @@ -19,7 +19,7 @@ import ( "github.com/pkg/errors" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/eventing" "github.com/stretchr/testify/require" diff --git a/internal/controller/eventing/controller.go b/internal/controller/batch/eventing/controller.go similarity index 99% rename from internal/controller/eventing/controller.go rename to internal/controller/batch/eventing/controller.go index b87908e1..c426c2a0 100644 --- a/internal/controller/eventing/controller.go +++ b/internal/controller/batch/eventing/controller.go @@ -43,7 +43,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/options" "github.com/kyma-project/eventing-manager/pkg/env" "github.com/kyma-project/eventing-manager/pkg/eventing" @@ -74,8 +74,8 @@ const ( // Reconciler reconciles an Eventing object // -//go:generate go run github.com/vektra/mockery/v2 --name=Controller --dir=../../../vendor/sigs.k8s.io/controller-runtime/pkg/controller --outpkg=mocks --case=underscore -//go:generate go run github.com/vektra/mockery/v2 --name=Manager --dir=../../../vendor/sigs.k8s.io/controller-runtime/pkg/manager --outpkg=mocks --case=underscore +//go:generate go run github.com/vektra/mockery/v2 --name=Controller --dir=../../../../vendor/sigs.k8s.io/controller-runtime/pkg/controller --outpkg=mocks --case=underscore +//go:generate go run github.com/vektra/mockery/v2 --name=Manager --dir=../../../../vendor/sigs.k8s.io/controller-runtime/pkg/manager --outpkg=mocks --case=underscore type Reconciler struct { client.Client logger *logger.Logger diff --git a/internal/controller/eventing/controller_test.go b/internal/controller/batch/eventing/controller_test.go similarity index 99% rename from internal/controller/eventing/controller_test.go rename to internal/controller/batch/eventing/controller_test.go index fe41b8d2..93db4bce 100644 --- a/internal/controller/eventing/controller_test.go +++ b/internal/controller/batch/eventing/controller_test.go @@ -9,7 +9,7 @@ import ( "github.com/kyma-project/eventing-manager/pkg/watcher" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" submanagermocks "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager/mocks" watchmock "github.com/kyma-project/eventing-manager/pkg/watcher/mocks" testutils "github.com/kyma-project/eventing-manager/test/utils" diff --git a/internal/controller/eventing/domain.go b/internal/controller/batch/eventing/domain.go similarity index 100% rename from internal/controller/eventing/domain.go rename to internal/controller/batch/eventing/domain.go diff --git a/internal/controller/eventing/domain_test.go b/internal/controller/batch/eventing/domain_test.go similarity index 100% rename from internal/controller/eventing/domain_test.go rename to internal/controller/batch/eventing/domain_test.go diff --git a/internal/controller/eventing/eventmesh.go b/internal/controller/batch/eventing/eventmesh.go similarity index 99% rename from internal/controller/eventing/eventmesh.go rename to internal/controller/batch/eventing/eventmesh.go index 8b11802d..07b4ef70 100644 --- a/internal/controller/eventing/eventmesh.go +++ b/internal/controller/batch/eventing/eventmesh.go @@ -14,7 +14,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/env" "github.com/kyma-project/eventing-manager/pkg/eventing" subscriptionmanager "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager" diff --git a/internal/controller/eventing/eventmesh_test.go b/internal/controller/batch/eventing/eventmesh_test.go similarity index 99% rename from internal/controller/eventing/eventmesh_test.go rename to internal/controller/batch/eventing/eventmesh_test.go index ac890e0f..f9d200ff 100644 --- a/internal/controller/eventing/eventmesh_test.go +++ b/internal/controller/batch/eventing/eventmesh_test.go @@ -7,7 +7,7 @@ import ( "github.com/kyma-project/eventing-manager/pkg/eventing" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/k8s" k8smocks "github.com/kyma-project/eventing-manager/pkg/k8s/mocks" diff --git a/internal/controller/eventing/integrationtests/controller/integration_test.go b/internal/controller/batch/eventing/integrationtests/controller/integration_test.go similarity index 97% rename from internal/controller/eventing/integrationtests/controller/integration_test.go rename to internal/controller/batch/eventing/integrationtests/controller/integration_test.go index 21eb17dc..2a206c38 100644 --- a/internal/controller/eventing/integrationtests/controller/integration_test.go +++ b/internal/controller/batch/eventing/integrationtests/controller/integration_test.go @@ -7,6 +7,8 @@ import ( "os" "testing" + eventing2 "github.com/kyma-project/eventing-manager/internal/controller/batch/eventing" + "github.com/onsi/gomega" gomegatypes "github.com/onsi/gomega/types" "github.com/stretchr/testify/require" @@ -19,8 +21,7 @@ import ( natsv1alpha1 "github.com/kyma-project/nats-manager/api/v1alpha1" natstestutils "github.com/kyma-project/nats-manager/testutils" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" - eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/eventing" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/eventing" "github.com/kyma-project/eventing-manager/pkg/k8s" "github.com/kyma-project/eventing-manager/test/matchers" @@ -29,7 +30,7 @@ import ( ) const ( - projectRootDir = "../../../../../" + projectRootDir = "../../../../../../" eventTypePrefix = "test-prefix" ) @@ -161,7 +162,7 @@ func Test_CreateEventingCR_NATS(t *testing.T) { g := gomega.NewWithT(t) // given - eventingcontroller.IsDeploymentReady = func(deployment *v1.Deployment) bool { + eventing2.IsDeploymentReady = func(deployment *v1.Deployment) bool { return tc.givenDeploymentReady } // create unique namespace for this test run. @@ -244,7 +245,7 @@ func Test_UpdateEventingCR(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { // given - eventingcontroller.IsDeploymentReady = func(deployment *v1.Deployment) bool { + eventing2.IsDeploymentReady = func(deployment *v1.Deployment) bool { return true } // create unique namespace for this test run. @@ -298,7 +299,7 @@ func Test_ReconcileSameEventingCR(t *testing.T) { //// // given //// - eventingcontroller.IsDeploymentReady = func(deployment *v1.Deployment) bool { return true } + eventing2.IsDeploymentReady = func(deployment *v1.Deployment) bool { return true } eventingCR := utils.NewEventingCR( utils.WithEventingCRMinimal(), @@ -527,7 +528,7 @@ func Test_WatcherEventingCRK8sObjects(t *testing.T) { // given g := gomega.NewWithT(t) - eventingcontroller.IsDeploymentReady = func(deployment *v1.Deployment) bool { + eventing2.IsDeploymentReady = func(deployment *v1.Deployment) bool { return true } @@ -637,7 +638,7 @@ func Test_CreateEventingCR_EventMesh(t *testing.T) { g := gomega.NewWithT(t) // given - eventingcontroller.IsDeploymentReady = func(deployment *v1.Deployment) bool { + eventing2.IsDeploymentReady = func(deployment *v1.Deployment) bool { return tc.givenDeploymentReady } @@ -719,7 +720,7 @@ func Test_DeleteEventingCR(t *testing.T) { givenSubscription: utils.NewSubscription("test-nats-subscription", "test-nats-namespace"), wantMatches: gomega.And( matchers.HaveStatusWarning(), - matchers.HaveDeletionErrorCondition(eventingcontroller.SubscriptionExistsErrMessage), + matchers.HaveDeletionErrorCondition(eventing2.SubscriptionExistsErrMessage), matchers.HaveFinalizer(), ), }, @@ -734,7 +735,7 @@ func Test_DeleteEventingCR(t *testing.T) { givenSubscription: utils.NewSubscription("test-eventmesh-subscription", "test-eventmesh-namespace"), wantMatches: gomega.And( matchers.HaveStatusWarning(), - matchers.HaveDeletionErrorCondition(eventingcontroller.SubscriptionExistsErrMessage), + matchers.HaveDeletionErrorCondition(eventing2.SubscriptionExistsErrMessage), matchers.HaveFinalizer(), ), }, @@ -747,7 +748,7 @@ func Test_DeleteEventingCR(t *testing.T) { g := gomega.NewWithT(t) // given - eventingcontroller.IsDeploymentReady = func(deployment *v1.Deployment) bool { + eventing2.IsDeploymentReady = func(deployment *v1.Deployment) bool { return true } @@ -924,7 +925,7 @@ func Test_WatcherNATSResource(t *testing.T) { g := gomega.NewWithT(t) // given - eventingcontroller.IsDeploymentReady = func(deployment *v1.Deployment) bool { + eventing2.IsDeploymentReady = func(deployment *v1.Deployment) bool { return true } diff --git a/internal/controller/eventing/integrationtests/controller_switching/integration_test.go b/internal/controller/batch/eventing/integrationtests/controller_switching/integration_test.go similarity index 98% rename from internal/controller/eventing/integrationtests/controller_switching/integration_test.go rename to internal/controller/batch/eventing/integrationtests/controller_switching/integration_test.go index 6cebfc2a..896d9503 100644 --- a/internal/controller/eventing/integrationtests/controller_switching/integration_test.go +++ b/internal/controller/batch/eventing/integrationtests/controller_switching/integration_test.go @@ -5,8 +5,9 @@ import ( "os" "testing" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" - eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/eventing" + eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/batch/eventing" + + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/eventing" "github.com/kyma-project/eventing-manager/test/matchers" "github.com/kyma-project/eventing-manager/test/utils" @@ -20,7 +21,7 @@ import ( ) const ( - projectRootDir = "../../../../../" + projectRootDir = "../../../../../../" ) var testEnvironment *testutils.TestEnvironment //nolint:gochecknoglobals // used in tests diff --git a/internal/controller/eventing/integrationtests/controllersinglecr/integration_test.go b/internal/controller/batch/eventing/integrationtests/controllersinglecr/integration_test.go similarity index 98% rename from internal/controller/eventing/integrationtests/controllersinglecr/integration_test.go rename to internal/controller/batch/eventing/integrationtests/controllersinglecr/integration_test.go index c0c2e38e..5a7c1da1 100644 --- a/internal/controller/eventing/integrationtests/controllersinglecr/integration_test.go +++ b/internal/controller/batch/eventing/integrationtests/controllersinglecr/integration_test.go @@ -7,7 +7,7 @@ import ( natstestutils "github.com/kyma-project/nats-manager/testutils" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/test/matchers" testutils "github.com/kyma-project/eventing-manager/test/utils" @@ -17,7 +17,7 @@ import ( ) const ( - projectRootDir = "../../../../../" + projectRootDir = "../../../../../../" ) var testEnvironment *integrationutils.TestEnvironment //nolint:gochecknoglobals // used in tests diff --git a/internal/controller/eventing/integrationtests/nats_disabled/integration_test.go b/internal/controller/batch/eventing/integrationtests/nats_disabled/integration_test.go similarity index 98% rename from internal/controller/eventing/integrationtests/nats_disabled/integration_test.go rename to internal/controller/batch/eventing/integrationtests/nats_disabled/integration_test.go index 34900aed..357e5dac 100644 --- a/internal/controller/eventing/integrationtests/nats_disabled/integration_test.go +++ b/internal/controller/batch/eventing/integrationtests/nats_disabled/integration_test.go @@ -5,14 +5,15 @@ import ( "os" "testing" - eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/eventing" + eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/batch/eventing" + "github.com/kyma-project/eventing-manager/pkg/k8s" "github.com/kyma-project/eventing-manager/test/matchers" "github.com/kyma-project/eventing-manager/test/utils" natstestutils "github.com/kyma-project/nats-manager/testutils" "github.com/onsi/gomega" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/eventing" testutils "github.com/kyma-project/eventing-manager/test/utils/integration" "github.com/stretchr/testify/require" @@ -20,7 +21,7 @@ import ( ) const ( - projectRootDir = "../../../../../" + projectRootDir = "../../../../../../" ) var testEnvironment *testutils.TestEnvironment //nolint:gochecknoglobals // used in tests diff --git a/internal/controller/eventing/integrationtests/validation/integration_test.go b/internal/controller/batch/eventing/integrationtests/validation/integration_test.go similarity index 99% rename from internal/controller/eventing/integrationtests/validation/integration_test.go rename to internal/controller/batch/eventing/integrationtests/validation/integration_test.go index 30eb069e..5921811a 100644 --- a/internal/controller/eventing/integrationtests/validation/integration_test.go +++ b/internal/controller/batch/eventing/integrationtests/validation/integration_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/test" eventingMatchers "github.com/kyma-project/eventing-manager/test/matchers" "github.com/kyma-project/eventing-manager/test/utils/integration" @@ -18,7 +18,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) -const projectRootDir = "../../../../../" +const projectRootDir = "../../../../../../" const noError = "" diff --git a/internal/controller/eventing/integrationtests/without_apirule_crd/integration_test.go b/internal/controller/batch/eventing/integrationtests/without_apirule_crd/integration_test.go similarity index 98% rename from internal/controller/eventing/integrationtests/without_apirule_crd/integration_test.go rename to internal/controller/batch/eventing/integrationtests/without_apirule_crd/integration_test.go index 15df3e46..7dc5f415 100644 --- a/internal/controller/eventing/integrationtests/without_apirule_crd/integration_test.go +++ b/internal/controller/batch/eventing/integrationtests/without_apirule_crd/integration_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/test/matchers" "github.com/kyma-project/eventing-manager/test/utils" testutils "github.com/kyma-project/eventing-manager/test/utils/integration" @@ -13,7 +13,7 @@ import ( ) const ( - projectRootDir = "../../../../../" + projectRootDir = "../../../../../../" ) var testEnvironment *testutils.TestEnvironment //nolint:gochecknoglobals // used in tests diff --git a/internal/controller/eventing/mocks/controller.go b/internal/controller/batch/eventing/mocks/controller.go similarity index 99% rename from internal/controller/eventing/mocks/controller.go rename to internal/controller/batch/eventing/mocks/controller.go index 62573857..7cc68336 100644 --- a/internal/controller/eventing/mocks/controller.go +++ b/internal/controller/batch/eventing/mocks/controller.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks diff --git a/internal/controller/eventing/mocks/manager.go b/internal/controller/batch/eventing/mocks/manager.go similarity index 99% rename from internal/controller/eventing/mocks/manager.go rename to internal/controller/batch/eventing/mocks/manager.go index dc7b9157..5f61310d 100644 --- a/internal/controller/eventing/mocks/manager.go +++ b/internal/controller/batch/eventing/mocks/manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks diff --git a/internal/controller/eventing/mocks/nats_config_handler.go b/internal/controller/batch/eventing/mocks/nats_config_handler.go similarity index 95% rename from internal/controller/eventing/mocks/nats_config_handler.go rename to internal/controller/batch/eventing/mocks/nats_config_handler.go index 08941244..4d0d4023 100644 --- a/internal/controller/eventing/mocks/nats_config_handler.go +++ b/internal/controller/batch/eventing/mocks/nats_config_handler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks @@ -9,7 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - v1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + v1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" ) // NatsConfigHandler is an autogenerated mock type for the NatsConfigHandler type diff --git a/internal/controller/eventing/nats.go b/internal/controller/batch/eventing/nats.go similarity index 98% rename from internal/controller/eventing/nats.go rename to internal/controller/batch/eventing/nats.go index d261754d..88b3829f 100644 --- a/internal/controller/eventing/nats.go +++ b/internal/controller/batch/eventing/nats.go @@ -6,7 +6,7 @@ import ( "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/options" "github.com/kyma-project/eventing-manager/pkg/env" "github.com/kyma-project/eventing-manager/pkg/k8s" diff --git a/internal/controller/eventing/nats_test.go b/internal/controller/batch/eventing/nats_test.go similarity index 99% rename from internal/controller/eventing/nats_test.go rename to internal/controller/batch/eventing/nats_test.go index 39e1df71..2b5dab17 100644 --- a/internal/controller/eventing/nats_test.go +++ b/internal/controller/batch/eventing/nats_test.go @@ -7,10 +7,11 @@ import ( "testing" "time" + "github.com/kyma-project/eventing-manager/internal/controller/batch/eventing/mocks" + submanagermocks "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager/mocks" - "github.com/kyma-project/eventing-manager/api/v1alpha1" - "github.com/kyma-project/eventing-manager/internal/controller/eventing/mocks" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/options" "github.com/kyma-project/eventing-manager/pkg/env" managermocks "github.com/kyma-project/eventing-manager/pkg/eventing/mocks" diff --git a/internal/controller/eventing/service_instance_secret.go b/internal/controller/batch/eventing/service_instance_secret.go similarity index 100% rename from internal/controller/eventing/service_instance_secret.go rename to internal/controller/batch/eventing/service_instance_secret.go diff --git a/internal/controller/eventing/status.go b/internal/controller/batch/eventing/status.go similarity index 99% rename from internal/controller/eventing/status.go rename to internal/controller/batch/eventing/status.go index 39715cc6..fbbf295d 100644 --- a/internal/controller/eventing/status.go +++ b/internal/controller/batch/eventing/status.go @@ -5,7 +5,7 @@ import ( "errors" "time" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "go.uber.org/zap" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/internal/controller/eventing/unit_test.go b/internal/controller/batch/eventing/unit_test.go similarity index 98% rename from internal/controller/eventing/unit_test.go rename to internal/controller/batch/eventing/unit_test.go index 200ca2e5..cd146c66 100644 --- a/internal/controller/eventing/unit_test.go +++ b/internal/controller/batch/eventing/unit_test.go @@ -4,6 +4,8 @@ import ( "context" "testing" + ctrlmocks "github.com/kyma-project/eventing-manager/internal/controller/batch/eventing/mocks" + apiclientsetfake "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake" "github.com/kyma-project/eventing-manager/pkg/k8s" @@ -16,11 +18,9 @@ import ( "github.com/kyma-project/eventing-manager/pkg/logger" - ctrlmocks "github.com/kyma-project/eventing-manager/internal/controller/eventing/mocks" - "k8s.io/apimachinery/pkg/runtime" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" managermocks "github.com/kyma-project/eventing-manager/pkg/eventing/mocks" natsv1alpha1 "github.com/kyma-project/nats-manager/api/v1alpha1" "github.com/stretchr/testify/require" diff --git a/internal/controller/eventing/utils.go b/internal/controller/batch/eventing/utils.go similarity index 99% rename from internal/controller/eventing/utils.go rename to internal/controller/batch/eventing/utils.go index b895581b..0db500cc 100644 --- a/internal/controller/eventing/utils.go +++ b/internal/controller/batch/eventing/utils.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/env" "github.com/mitchellh/hashstructure/v2" ctrl "sigs.k8s.io/controller-runtime" diff --git a/internal/controller/eventing/utils_test.go b/internal/controller/batch/eventing/utils_test.go similarity index 99% rename from internal/controller/eventing/utils_test.go rename to internal/controller/batch/eventing/utils_test.go index 38f49b12..22771186 100644 --- a/internal/controller/eventing/utils_test.go +++ b/internal/controller/batch/eventing/utils_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + eventingv1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/test/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/controller/eventing/webhook.go b/internal/controller/batch/eventing/webhook.go similarity index 100% rename from internal/controller/eventing/webhook.go rename to internal/controller/batch/eventing/webhook.go diff --git a/internal/controller/eventing/webhook_test.go b/internal/controller/batch/eventing/webhook_test.go similarity index 100% rename from internal/controller/eventing/webhook_test.go rename to internal/controller/batch/eventing/webhook_test.go diff --git a/pkg/backend/jetstream/mocks/Backend.go b/pkg/backend/jetstream/mocks/Backend.go index a161155d..1dab8391 100644 --- a/pkg/backend/jetstream/mocks/Backend.go +++ b/pkg/backend/jetstream/mocks/Backend.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks diff --git a/pkg/backend/jetstream/mocks/JetStreamContext.go b/pkg/backend/jetstream/mocks/JetStreamContext.go index 51395680..a2150ef3 100644 --- a/pkg/backend/jetstream/mocks/JetStreamContext.go +++ b/pkg/backend/jetstream/mocks/JetStreamContext.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks diff --git a/pkg/ems/api/events/client/mocks/PublisherManager.go b/pkg/ems/api/events/client/mocks/PublisherManager.go index f9209293..c575f6f7 100644 --- a/pkg/ems/api/events/client/mocks/PublisherManager.go +++ b/pkg/ems/api/events/client/mocks/PublisherManager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index c38088e6..52926e4d 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -4,7 +4,7 @@ import ( "strings" "time" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kelseyhightower/envconfig" ) diff --git a/pkg/eventing/deployment.go b/pkg/eventing/deployment.go index a12dd234..368784bf 100644 --- a/pkg/eventing/deployment.go +++ b/pkg/eventing/deployment.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/env" "github.com/kyma-project/eventing-manager/pkg/utils" ) diff --git a/pkg/eventing/deployment_test.go b/pkg/eventing/deployment_test.go index d136c720..343abfe8 100644 --- a/pkg/eventing/deployment_test.go +++ b/pkg/eventing/deployment_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/env" "github.com/kyma-project/eventing-manager/test" testutils "github.com/kyma-project/eventing-manager/test/utils" diff --git a/pkg/eventing/manager.go b/pkg/eventing/manager.go index 06e2ac8b..3f7486ea 100644 --- a/pkg/eventing/manager.go +++ b/pkg/eventing/manager.go @@ -11,7 +11,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/env" "github.com/kyma-project/eventing-manager/pkg/k8s" "github.com/kyma-project/eventing-manager/pkg/logger" diff --git a/pkg/eventing/manager_test.go b/pkg/eventing/manager_test.go index 3facc851..84f684e3 100644 --- a/pkg/eventing/manager_test.go +++ b/pkg/eventing/manager_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/env" k8smocks "github.com/kyma-project/eventing-manager/pkg/k8s/mocks" testutils "github.com/kyma-project/eventing-manager/test/utils" diff --git a/pkg/eventing/mocks/manager.go b/pkg/eventing/mocks/manager.go index e6331173..d39723a1 100644 --- a/pkg/eventing/mocks/manager.go +++ b/pkg/eventing/mocks/manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks @@ -11,7 +11,7 @@ import ( v1 "k8s.io/api/apps/v1" - v1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + v1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" ) // Manager is an autogenerated mock type for the Manager type diff --git a/pkg/eventing/utils.go b/pkg/eventing/utils.go index 1fd200ee..b2ff85fe 100644 --- a/pkg/eventing/utils.go +++ b/pkg/eventing/utils.go @@ -3,7 +3,7 @@ package eventing import ( "fmt" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" ecv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" autoscalingv2 "k8s.io/api/autoscaling/v2" corev1 "k8s.io/api/core/v1" diff --git a/pkg/eventing/utils_test.go b/pkg/eventing/utils_test.go index 19f74eab..d9518c97 100644 --- a/pkg/eventing/utils_test.go +++ b/pkg/eventing/utils_test.go @@ -3,7 +3,7 @@ package eventing import ( "testing" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/k8s/mocks/client.go b/pkg/k8s/mocks/client.go index 3711ed0d..35c6ef5c 100644 --- a/pkg/k8s/mocks/client.go +++ b/pkg/k8s/mocks/client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks diff --git a/pkg/subscriptionmanager/factory.go b/pkg/subscriptionmanager/factory.go index 1eaa66f1..1f4b4209 100644 --- a/pkg/subscriptionmanager/factory.go +++ b/pkg/subscriptionmanager/factory.go @@ -6,7 +6,7 @@ import ( "github.com/kyma-project/eventing-manager/pkg/backend/metrics" "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/pkg/env" eclogger "github.com/kyma-project/eventing-manager/pkg/logger" "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/eventmesh" diff --git a/pkg/subscriptionmanager/manager/mocks/manager.go b/pkg/subscriptionmanager/manager/mocks/manager.go index 98e52f51..25b716cd 100644 --- a/pkg/subscriptionmanager/manager/mocks/manager.go +++ b/pkg/subscriptionmanager/manager/mocks/manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks diff --git a/pkg/subscriptionmanager/mocks/manager_factory.go b/pkg/subscriptionmanager/mocks/manager_factory.go index 647192de..a78d5f95 100644 --- a/pkg/subscriptionmanager/mocks/manager_factory.go +++ b/pkg/subscriptionmanager/mocks/manager_factory.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks @@ -7,7 +7,7 @@ import ( manager "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager" mock "github.com/stretchr/testify/mock" - v1alpha1 "github.com/kyma-project/eventing-manager/api/v1alpha1" + v1alpha1 "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" ) // ManagerFactory is an autogenerated mock type for the ManagerFactory type diff --git a/pkg/watcher/mocks/watcher.go b/pkg/watcher/mocks/watcher.go index 3e9cb36d..4341c7ec 100644 --- a/pkg/watcher/mocks/watcher.go +++ b/pkg/watcher/mocks/watcher.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.37.1. DO NOT EDIT. package mocks diff --git a/test/matchers/matchers.go b/test/matchers/matchers.go index 311a39be..35e8df15 100644 --- a/test/matchers/matchers.go +++ b/test/matchers/matchers.go @@ -1,8 +1,8 @@ package matchers import ( - "github.com/kyma-project/eventing-manager/api/v1alpha1" - "github.com/kyma-project/eventing-manager/internal/controller/eventing" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" + "github.com/kyma-project/eventing-manager/internal/controller/batch/eventing" "github.com/onsi/gomega" "github.com/onsi/gomega/gstruct" gomegatypes "github.com/onsi/gomega/types" diff --git a/test/utils/integration/integration.go b/test/utils/integration/integration.go index 5515a56e..7a682df1 100644 --- a/test/utils/integration/integration.go +++ b/test/utils/integration/integration.go @@ -5,13 +5,15 @@ import ( "context" "crypto/rand" "fmt" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "log" "path/filepath" "strings" "testing" "time" + eventing2 "github.com/kyma-project/eventing-manager/internal/controller/batch/eventing" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager" "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager" submanagermocks "github.com/kyma-project/eventing-manager/pkg/subscriptionmanager/manager/mocks" @@ -51,8 +53,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "github.com/kyma-project/eventing-manager/api/v1alpha1" - eventingctrl "github.com/kyma-project/eventing-manager/internal/controller/eventing" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" "github.com/kyma-project/eventing-manager/options" "github.com/kyma-project/eventing-manager/pkg/env" "github.com/kyma-project/eventing-manager/pkg/eventing" @@ -79,7 +80,7 @@ type TestEnvironment struct { k8sClient client.Client KubeClient k8s.Client K8sDynamicClient *dynamic.DynamicClient - Reconciler *eventingctrl.Reconciler + Reconciler *eventing2.Reconciler Logger *logger.Logger Recorder *record.EventRecorder TestCancelFn context.CancelFunc @@ -197,7 +198,7 @@ func NewTestEnvironment(config TestEnvironmentConfig) (*TestEnvironment, error) subManagerFactoryMock.On("NewEventMeshManager", mock.Anything).Return(eventMeshSubManagerMock, nil) // create a new watcher - eventingReconciler := eventingctrl.NewReconciler( + eventingReconciler := eventing2.NewReconciler( k8sClient, kubeClient, dynamicClient, @@ -854,12 +855,12 @@ func (env TestEnvironment) EnsureCABundleInjectedIntoWebhooks(t *testing.T) { return false } - if !bytes.Equal(mwh.Webhooks[0].ClientConfig.CABundle, certSecret.Data[eventingctrl.TLSCertField]) { + if !bytes.Equal(mwh.Webhooks[0].ClientConfig.CABundle, certSecret.Data[eventing2.TLSCertField]) { env.Logger.WithContext().Error("CABundle of mutating configuration is not correct") return false } - if !bytes.Equal(vwh.Webhooks[0].ClientConfig.CABundle, certSecret.Data[eventingctrl.TLSCertField]) { + if !bytes.Equal(vwh.Webhooks[0].ClientConfig.CABundle, certSecret.Data[eventing2.TLSCertField]) { env.Logger.WithContext().Error("CABundle of validating configuration is not correct") return false } @@ -992,7 +993,7 @@ func newSecretWithTLSSecret(dummyCABundle []byte) *corev1.Secret { Namespace: getTestBackendConfig().Namespace, }, Data: map[string][]byte{ - eventingctrl.TLSCertField: dummyCABundle, + eventing2.TLSCertField: dummyCABundle, }, } } diff --git a/test/utils/options.go b/test/utils/options.go index 1688e58e..55f4e2f4 100644 --- a/test/utils/options.go +++ b/test/utils/options.go @@ -1,7 +1,7 @@ package utils import ( - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/utils/utils.go b/test/utils/utils.go index 0b36de56..a4fd2294 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -20,7 +20,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/kyma-project/eventing-manager/api/v1alpha1" + "github.com/kyma-project/eventing-manager/api/batch/v1alpha1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" )