diff --git a/backend/pkg/api/connect/integration/acl_test.go b/backend/pkg/api/connect/integration/acl_v1alpha1_test.go similarity index 95% rename from backend/pkg/api/connect/integration/acl_test.go rename to backend/pkg/api/connect/integration/acl_v1alpha1_test.go index be8f7a9cf..fadc38e33 100644 --- a/backend/pkg/api/connect/integration/acl_test.go +++ b/backend/pkg/api/connect/integration/acl_v1alpha1_test.go @@ -30,7 +30,7 @@ import ( v1alpha1connect "github.com/redpanda-data/console/backend/pkg/protogen/redpanda/api/dataplane/v1alpha1/dataplanev1alpha1connect" ) -func (s *APISuite) DeleteAllACLs(ctx context.Context) error { +func (s *APISuite) DeleteAllACLs_V1Alpha1(ctx context.Context) error { acls := kadm.NewACLs(). Allow(). ResourcePatternType(kadm.ACLPatternAny). @@ -48,7 +48,7 @@ func (s *APISuite) DeleteAllACLs(ctx context.Context) error { } //nolint:unparam // Principal always receives "User:test" as of now, but good to keep for clarity -func (*APISuite) newStdACLResource(resourceType v1alpha1.ACL_ResourceType, resourceName string, principal string) *v1alpha1.ListACLsResponse_Resource { +func (*APISuite) newStdACLResource_V1Alpha1(resourceType v1alpha1.ACL_ResourceType, resourceName string, principal string) *v1alpha1.ListACLsResponse_Resource { return &v1alpha1.ListACLsResponse_Resource{ ResourceType: resourceType, ResourceName: resourceName, @@ -64,7 +64,7 @@ func (*APISuite) newStdACLResource(resourceType v1alpha1.ACL_ResourceType, resou } } -func (s *APISuite) TestCreateACL() { +func (s *APISuite) TestCreateACL_V1Alpha1() { t := s.T() t.Run("create ACL with default request (connect-go)", func(t *testing.T) { @@ -91,7 +91,7 @@ func (s *APISuite) TestCreateACL() { defer func() { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() - err := s.DeleteAllACLs(ctx) + err := s.DeleteAllACLs_V1Alpha1(ctx) assert.NoError(err, "failed to delete all ACLs") }() @@ -159,7 +159,7 @@ func (s *APISuite) TestCreateACL() { defer func() { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() - err := s.DeleteAllACLs(ctx) + err := s.DeleteAllACLs_V1Alpha1(ctx) assert.NoError(err, "failed to delete all ACLs") }() @@ -235,13 +235,13 @@ func (s *APISuite) TestCreateACL() { defer func() { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() - err := s.DeleteAllACLs(ctx) + err := s.DeleteAllACLs_V1Alpha1(ctx) assert.NoError(err, "failed to delete all ACLs") }() }) } -func (s *APISuite) TestListACLs() { +func (s *APISuite) TestListACLs_V1Alpha1() { t := s.T() t.Run("list ACLs with default request (connect-go)", func(t *testing.T) { @@ -280,7 +280,7 @@ func (s *APISuite) TestListACLs() { defer func() { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() - err := s.DeleteAllACLs(ctx) + err := s.DeleteAllACLs_V1Alpha1(ctx) assert.NoError(err, "failed to delete all ACLs") }() @@ -314,10 +314,10 @@ func (s *APISuite) TestListACLs() { // 4. Compare all filtered resources against expected ACLs expectedResources := map[v1alpha1.ACL_ResourceType]*v1alpha1.ListACLsResponse_Resource{ - v1alpha1.ACL_RESOURCE_TYPE_TOPIC: s.newStdACLResource(v1alpha1.ACL_RESOURCE_TYPE_TOPIC, resourceNames[v1alpha1.ACL_RESOURCE_TYPE_TOPIC], principal), - v1alpha1.ACL_RESOURCE_TYPE_TRANSACTIONAL_ID: s.newStdACLResource(v1alpha1.ACL_RESOURCE_TYPE_TRANSACTIONAL_ID, resourceNames[v1alpha1.ACL_RESOURCE_TYPE_TRANSACTIONAL_ID], principal), - v1alpha1.ACL_RESOURCE_TYPE_GROUP: s.newStdACLResource(v1alpha1.ACL_RESOURCE_TYPE_GROUP, resourceNames[v1alpha1.ACL_RESOURCE_TYPE_GROUP], principal), - v1alpha1.ACL_RESOURCE_TYPE_CLUSTER: s.newStdACLResource(v1alpha1.ACL_RESOURCE_TYPE_CLUSTER, resourceNames[v1alpha1.ACL_RESOURCE_TYPE_CLUSTER], principal), + v1alpha1.ACL_RESOURCE_TYPE_TOPIC: s.newStdACLResource_V1Alpha1(v1alpha1.ACL_RESOURCE_TYPE_TOPIC, resourceNames[v1alpha1.ACL_RESOURCE_TYPE_TOPIC], principal), + v1alpha1.ACL_RESOURCE_TYPE_TRANSACTIONAL_ID: s.newStdACLResource_V1Alpha1(v1alpha1.ACL_RESOURCE_TYPE_TRANSACTIONAL_ID, resourceNames[v1alpha1.ACL_RESOURCE_TYPE_TRANSACTIONAL_ID], principal), + v1alpha1.ACL_RESOURCE_TYPE_GROUP: s.newStdACLResource_V1Alpha1(v1alpha1.ACL_RESOURCE_TYPE_GROUP, resourceNames[v1alpha1.ACL_RESOURCE_TYPE_GROUP], principal), + v1alpha1.ACL_RESOURCE_TYPE_CLUSTER: s.newStdACLResource_V1Alpha1(v1alpha1.ACL_RESOURCE_TYPE_CLUSTER, resourceNames[v1alpha1.ACL_RESOURCE_TYPE_CLUSTER], principal), } assert.Len(filteredResources, len(expectedResources)) @@ -383,7 +383,7 @@ func (s *APISuite) TestListACLs() { defer func() { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() - err := s.DeleteAllACLs(ctx) + err := s.DeleteAllACLs_V1Alpha1(ctx) assert.NoError(err, "failed to delete all ACLs") }() @@ -418,7 +418,7 @@ func (s *APISuite) TestListACLs() { }) } -func (s *APISuite) TestDeleteACLs() { +func (s *APISuite) TestDeleteACLs_V1Alpha1() { t := s.T() t.Run("delete ACLs with a filter that matches all three created ACLs (connect-go)", func(t *testing.T) { @@ -455,7 +455,7 @@ func (s *APISuite) TestDeleteACLs() { defer func() { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() - err := s.DeleteAllACLs(ctx) + err := s.DeleteAllACLs_V1Alpha1(ctx) assert.NoError(err, "failed to delete all ACLs") }() @@ -531,7 +531,7 @@ func (s *APISuite) TestDeleteACLs() { defer func() { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() - err := s.DeleteAllACLs(ctx) + err := s.DeleteAllACLs_V1Alpha1(ctx) assert.NoError(err, "failed to delete all ACLs") }() diff --git a/backend/pkg/api/connect/integration/kafkaconnect_test.go b/backend/pkg/api/connect/integration/kafkaconnect_v1alpha1_test.go similarity index 98% rename from backend/pkg/api/connect/integration/kafkaconnect_test.go rename to backend/pkg/api/connect/integration/kafkaconnect_v1alpha1_test.go index b1fdc2d9b..f8c05325f 100644 --- a/backend/pkg/api/connect/integration/kafkaconnect_test.go +++ b/backend/pkg/api/connect/integration/kafkaconnect_v1alpha1_test.go @@ -28,7 +28,7 @@ import ( "github.com/redpanda-data/console/backend/pkg/testutil" ) -func (s *APISuite) TestListConnectors() { +func (s *APISuite) TestListConnectors_V1Alpha1() { t := s.T() t.Run("list Connectors with invalid Request (connect-go)", func(t *testing.T) { @@ -64,7 +64,7 @@ func (s *APISuite) TestListConnectors() { }) } -func (s *APISuite) TestListConnectClusters() { +func (s *APISuite) TestListConnectClusters_V1Alpha1() { t := s.T() t.Run("list connect clusters request (connect-go)", func(t *testing.T) { @@ -123,7 +123,7 @@ func (s *APISuite) TestListConnectClusters() { }) } -func (s *APISuite) TestGetConnectorAndStatus() { +func (s *APISuite) TestGetConnectorAndStatus_V1Alpha1() { t := s.T() requireT := require.New(t) diff --git a/backend/pkg/api/connect/integration/topic_test.go b/backend/pkg/api/connect/integration/topic_v1alpha1_test.go similarity index 99% rename from backend/pkg/api/connect/integration/topic_test.go rename to backend/pkg/api/connect/integration/topic_v1alpha1_test.go index f4f484be2..355780637 100644 --- a/backend/pkg/api/connect/integration/topic_test.go +++ b/backend/pkg/api/connect/integration/topic_v1alpha1_test.go @@ -30,7 +30,7 @@ import ( v1alpha1connect "github.com/redpanda-data/console/backend/pkg/protogen/redpanda/api/dataplane/v1alpha1/dataplanev1alpha1connect" ) -func (s *APISuite) TestListTopics() { +func (s *APISuite) TestListTopics_V1Alpha1() { t := s.T() // Seed some topics that can be listed @@ -197,7 +197,7 @@ func (s *APISuite) TestListTopics() { }) } -func (s *APISuite) TestCreateTopic() { +func (s *APISuite) TestCreateTopic_V1Alpha1() { t := s.T() t.Run("create topic with valid request (connect-go)", func(t *testing.T) { @@ -485,7 +485,7 @@ func (s *APISuite) TestCreateTopic() { }) } -func (s *APISuite) TestDeleteTopic() { +func (s *APISuite) TestDeleteTopic_V1Alpha1() { t := s.T() t.Run("delete topic with valid request (connect-go)", func(t *testing.T) { @@ -643,7 +643,7 @@ func (s *APISuite) TestDeleteTopic() { }) } -func (s *APISuite) TestGetTopicConfiguration() { +func (s *APISuite) TestGetTopicConfiguration_V1Alpha1() { t := s.T() t.Run("get topic configuration of a valid topic (connect-go)", func(t *testing.T) { @@ -788,7 +788,7 @@ func (s *APISuite) TestGetTopicConfiguration() { }) } -func (s *APISuite) TestUpdateTopicConfiguration() { +func (s *APISuite) TestUpdateTopicConfiguration_V1Alpha1() { t := s.T() t.Run("update topic configuration of a valid topic (connect-go)", func(t *testing.T) { @@ -1086,7 +1086,7 @@ func (s *APISuite) TestUpdateTopicConfiguration() { }) } -func (s *APISuite) TestSetTopicConfiguration() { +func (s *APISuite) TestSetTopicConfiguration_V1Alpha1() { t := s.T() t.Run("set topic configuration of a valid topic (connect-go)", func(t *testing.T) { diff --git a/backend/pkg/api/connect/integration/transform_test.go b/backend/pkg/api/connect/integration/transform_v1alpha1_test.go similarity index 99% rename from backend/pkg/api/connect/integration/transform_test.go rename to backend/pkg/api/connect/integration/transform_v1alpha1_test.go index 7b377a742..1e8404b66 100644 --- a/backend/pkg/api/connect/integration/transform_test.go +++ b/backend/pkg/api/connect/integration/transform_v1alpha1_test.go @@ -41,7 +41,7 @@ import ( var identityTransform []byte // DirectDeployAndTestTransform encapsulates the logic for creating a transform and asserting its successful creation. -func (s *APISuite) TestDeployTransform() { +func (s *APISuite) TestDeployTransform_V1Alpha1() { t := s.T() type KeyVal struct { @@ -356,7 +356,7 @@ func (s *APISuite) TestDeployTransform() { }) } -func (s *APISuite) TestGetTransform() { +func (s *APISuite) TestGetTransform_V1Alpha1() { t := s.T() assert := assertpkg.New(t) @@ -555,7 +555,7 @@ func (s *APISuite) TestGetTransform() { }) } -func (s *APISuite) TestListTransforms() { +func (s *APISuite) TestListTransforms_V1Alpha1() { t := s.T() require := requirepkg.New(t) @@ -682,7 +682,7 @@ func (s *APISuite) TestListTransforms() { }) } -func (s *APISuite) TestDeleteTransforms() { +func (s *APISuite) TestDeleteTransforms_V1Alpha1() { t := s.T() require := requirepkg.New(t) diff --git a/backend/pkg/api/connect/integration/user_test.go b/backend/pkg/api/connect/integration/user_v1alpha1_test.go similarity index 99% rename from backend/pkg/api/connect/integration/user_test.go rename to backend/pkg/api/connect/integration/user_v1alpha1_test.go index 5e724c5cf..0ca2a44e7 100644 --- a/backend/pkg/api/connect/integration/user_test.go +++ b/backend/pkg/api/connect/integration/user_v1alpha1_test.go @@ -27,7 +27,7 @@ import ( v1alpha1connect "github.com/redpanda-data/console/backend/pkg/protogen/redpanda/api/dataplane/v1alpha1/dataplanev1alpha1connect" ) -func (s *APISuite) TestListUsers() { +func (s *APISuite) TestListUsers_V1Alpha1() { t := s.T() t.Run("list users with valid request (connect-go)", func(t *testing.T) { diff --git a/backend/pkg/api/connect/service/acl/defaulter.go b/backend/pkg/api/connect/service/acl/v1alpha1/defaulter.go similarity index 100% rename from backend/pkg/api/connect/service/acl/defaulter.go rename to backend/pkg/api/connect/service/acl/v1alpha1/defaulter.go diff --git a/backend/pkg/api/connect/service/acl/defaulter_test.go b/backend/pkg/api/connect/service/acl/v1alpha1/defaulter_test.go similarity index 100% rename from backend/pkg/api/connect/service/acl/defaulter_test.go rename to backend/pkg/api/connect/service/acl/v1alpha1/defaulter_test.go diff --git a/backend/pkg/api/connect/service/acl/mapper.go b/backend/pkg/api/connect/service/acl/v1alpha1/mapper.go similarity index 100% rename from backend/pkg/api/connect/service/acl/mapper.go rename to backend/pkg/api/connect/service/acl/v1alpha1/mapper.go diff --git a/backend/pkg/api/connect/service/acl/mapper_enums.go b/backend/pkg/api/connect/service/acl/v1alpha1/mapper_enums.go similarity index 100% rename from backend/pkg/api/connect/service/acl/mapper_enums.go rename to backend/pkg/api/connect/service/acl/v1alpha1/mapper_enums.go diff --git a/backend/pkg/api/connect/service/acl/mapper_test.go b/backend/pkg/api/connect/service/acl/v1alpha1/mapper_test.go similarity index 100% rename from backend/pkg/api/connect/service/acl/mapper_test.go rename to backend/pkg/api/connect/service/acl/v1alpha1/mapper_test.go diff --git a/backend/pkg/api/connect/service/acl/service.go b/backend/pkg/api/connect/service/acl/v1alpha1/service.go similarity index 100% rename from backend/pkg/api/connect/service/acl/service.go rename to backend/pkg/api/connect/service/acl/v1alpha1/service.go diff --git a/backend/pkg/api/connect/service/common/mapper.go b/backend/pkg/api/connect/service/common/v1alpha1/mapper.go similarity index 100% rename from backend/pkg/api/connect/service/common/mapper.go rename to backend/pkg/api/connect/service/common/v1alpha1/mapper.go diff --git a/backend/pkg/api/connect/service/kafkaconnect/defaulter.go b/backend/pkg/api/connect/service/kafkaconnect/v1alpha1/defaulter.go similarity index 100% rename from backend/pkg/api/connect/service/kafkaconnect/defaulter.go rename to backend/pkg/api/connect/service/kafkaconnect/v1alpha1/defaulter.go diff --git a/backend/pkg/api/connect/service/kafkaconnect/mapper.go b/backend/pkg/api/connect/service/kafkaconnect/v1alpha1/mapper.go similarity index 100% rename from backend/pkg/api/connect/service/kafkaconnect/mapper.go rename to backend/pkg/api/connect/service/kafkaconnect/v1alpha1/mapper.go diff --git a/backend/pkg/api/connect/service/kafkaconnect/service.go b/backend/pkg/api/connect/service/kafkaconnect/v1alpha1/service.go similarity index 100% rename from backend/pkg/api/connect/service/kafkaconnect/service.go rename to backend/pkg/api/connect/service/kafkaconnect/v1alpha1/service.go diff --git a/backend/pkg/api/connect/service/topic/defaulter.go b/backend/pkg/api/connect/service/topic/v1alpha1/defaulter.go similarity index 100% rename from backend/pkg/api/connect/service/topic/defaulter.go rename to backend/pkg/api/connect/service/topic/v1alpha1/defaulter.go diff --git a/backend/pkg/api/connect/service/topic/mapper.go b/backend/pkg/api/connect/service/topic/v1alpha1/mapper.go similarity index 98% rename from backend/pkg/api/connect/service/topic/mapper.go rename to backend/pkg/api/connect/service/topic/v1alpha1/mapper.go index d1bdfe6c8..2a67766ac 100644 --- a/backend/pkg/api/connect/service/topic/mapper.go +++ b/backend/pkg/api/connect/service/topic/v1alpha1/mapper.go @@ -14,7 +14,7 @@ import ( "github.com/twmb/franz-go/pkg/kmsg" - "github.com/redpanda-data/console/backend/pkg/api/connect/service/common" + common "github.com/redpanda-data/console/backend/pkg/api/connect/service/common/v1alpha1" v1alpha1 "github.com/redpanda-data/console/backend/pkg/protogen/redpanda/api/dataplane/v1alpha1" ) diff --git a/backend/pkg/api/connect/service/topic/mapper_test.go b/backend/pkg/api/connect/service/topic/v1alpha1/mapper_test.go similarity index 100% rename from backend/pkg/api/connect/service/topic/mapper_test.go rename to backend/pkg/api/connect/service/topic/v1alpha1/mapper_test.go diff --git a/backend/pkg/api/connect/service/topic/service.go b/backend/pkg/api/connect/service/topic/v1alpha1/service.go similarity index 100% rename from backend/pkg/api/connect/service/topic/service.go rename to backend/pkg/api/connect/service/topic/v1alpha1/service.go diff --git a/backend/pkg/api/connect/service/topic/util.go b/backend/pkg/api/connect/service/topic/v1alpha1/util.go similarity index 100% rename from backend/pkg/api/connect/service/topic/util.go rename to backend/pkg/api/connect/service/topic/v1alpha1/util.go diff --git a/backend/pkg/api/connect/service/transform/console.go b/backend/pkg/api/connect/service/transform/v1alpha1/console.go similarity index 100% rename from backend/pkg/api/connect/service/transform/console.go rename to backend/pkg/api/connect/service/transform/v1alpha1/console.go diff --git a/backend/pkg/api/connect/service/transform/defaulter.go b/backend/pkg/api/connect/service/transform/v1alpha1/defaulter.go similarity index 100% rename from backend/pkg/api/connect/service/transform/defaulter.go rename to backend/pkg/api/connect/service/transform/v1alpha1/defaulter.go diff --git a/backend/pkg/api/connect/service/transform/handle_transforms.go b/backend/pkg/api/connect/service/transform/v1alpha1/handle_transforms.go similarity index 100% rename from backend/pkg/api/connect/service/transform/handle_transforms.go rename to backend/pkg/api/connect/service/transform/v1alpha1/handle_transforms.go diff --git a/backend/pkg/api/connect/service/transform/mapper.go b/backend/pkg/api/connect/service/transform/v1alpha1/mapper.go similarity index 100% rename from backend/pkg/api/connect/service/transform/mapper.go rename to backend/pkg/api/connect/service/transform/v1alpha1/mapper.go diff --git a/backend/pkg/api/connect/service/transform/service.go b/backend/pkg/api/connect/service/transform/v1alpha1/service.go similarity index 100% rename from backend/pkg/api/connect/service/transform/service.go rename to backend/pkg/api/connect/service/transform/v1alpha1/service.go diff --git a/backend/pkg/api/connect/service/transform/util.go b/backend/pkg/api/connect/service/transform/v1alpha1/util.go similarity index 100% rename from backend/pkg/api/connect/service/transform/util.go rename to backend/pkg/api/connect/service/transform/v1alpha1/util.go diff --git a/backend/pkg/api/connect/service/transform/util_test.go b/backend/pkg/api/connect/service/transform/v1alpha1/util_test.go similarity index 100% rename from backend/pkg/api/connect/service/transform/util_test.go rename to backend/pkg/api/connect/service/transform/v1alpha1/util_test.go diff --git a/backend/pkg/api/connect/service/user/defaulter.go b/backend/pkg/api/connect/service/user/v1alpha1/defaulter.go similarity index 100% rename from backend/pkg/api/connect/service/user/defaulter.go rename to backend/pkg/api/connect/service/user/v1alpha1/defaulter.go diff --git a/backend/pkg/api/connect/service/user/mapper.go b/backend/pkg/api/connect/service/user/v1alpha1/mapper.go similarity index 100% rename from backend/pkg/api/connect/service/user/mapper.go rename to backend/pkg/api/connect/service/user/v1alpha1/mapper.go diff --git a/backend/pkg/api/connect/service/user/service.go b/backend/pkg/api/connect/service/user/v1alpha1/service.go similarity index 100% rename from backend/pkg/api/connect/service/user/service.go rename to backend/pkg/api/connect/service/user/v1alpha1/service.go diff --git a/backend/pkg/api/routes.go b/backend/pkg/api/routes.go index 5d4d0cea6..814c3ec21 100644 --- a/backend/pkg/api/routes.go +++ b/backend/pkg/api/routes.go @@ -31,13 +31,13 @@ import ( apierrors "github.com/redpanda-data/console/backend/pkg/api/connect/errors" "github.com/redpanda-data/console/backend/pkg/api/connect/interceptor" - apiaclsvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/acl" + apiaclsvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/acl/v1alpha1" consolesvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/console" - apikafkaconnectsvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/kafkaconnect" + apikafkaconnectsvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/kafkaconnect/v1alpha1" "github.com/redpanda-data/console/backend/pkg/api/connect/service/rpconnect" - topicsvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/topic" - transformsvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/transform" - apiusersvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/user" + topicsvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/topic/v1alpha1" + transformsvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/transform/v1alpha1" + apiusersvc "github.com/redpanda-data/console/backend/pkg/api/connect/service/user/v1alpha1" "github.com/redpanda-data/console/backend/pkg/protogen/redpanda/api/console/v1alpha1/consolev1alpha1connect" "github.com/redpanda-data/console/backend/pkg/protogen/redpanda/api/dataplane/v1alpha1/dataplanev1alpha1connect" "github.com/redpanda-data/console/backend/pkg/version"