diff --git a/pkg/service/component_definition.go b/pkg/service/component_definition.go index 665b77172..15d8e79b8 100644 --- a/pkg/service/component_definition.go +++ b/pkg/service/component_definition.go @@ -11,6 +11,7 @@ import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" + "github.com/instill-ai/pipeline-backend/config" "github.com/instill-ai/pipeline-backend/pkg/recipe" "github.com/instill-ai/pipeline-backend/pkg/repository" "github.com/instill-ai/x/paginate" @@ -222,6 +223,14 @@ func (s *service) ListComponentDefinitions(ctx context.Context, req *pb.ListComp if req.GetView() != pb.ComponentDefinition_VIEW_FULL { def.Spec = nil } + + // Temporary solution to filter out the instill-app component for local-ce:dev edition + // In the future, when it is a confirmed requirement, we can add a new field in the + // component definition to mark it as hidden. + if skipComponentInCE(def.GetId()) { + continue + } + defs[i] = def } @@ -235,6 +244,17 @@ func (s *service) ListComponentDefinitions(ctx context.Context, req *pb.ListComp return resp, nil } +var skipComponentsInCE = map[string]bool{ + "instill-app": true, +} + +func skipComponentInCE(componentID string) bool { + if skipComponentsInCE[componentID] && config.Config.Server.Edition == "local-ce:dev" { + return true + } + return false +} + var implementedReleaseStages = map[pb.ComponentDefinition_ReleaseStage]bool{ pb.ComponentDefinition_RELEASE_STAGE_ALPHA: true, pb.ComponentDefinition_RELEASE_STAGE_BETA: true,