Skip to content

Commit

Permalink
feat(component): exclude ee version only component in ce version
Browse files Browse the repository at this point in the history
fix: modify name
  • Loading branch information
chuang8511 committed Sep 24, 2024
1 parent e757723 commit ce15c32
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/service/component_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand All @@ -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,
Expand Down

0 comments on commit ce15c32

Please sign in to comment.