Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Fix list named entities (#609)
Browse files Browse the repository at this point in the history
Signed-off-by: Iaroslav Ciupin <[email protected]>
  • Loading branch information
iaroslav-ciupin authored Sep 1, 2023
1 parent b3177ef commit 1df2d18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
5 changes: 3 additions & 2 deletions pkg/common/sorting.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package common

import (
"fmt"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/flyteorg/flyteadmin/pkg/errors"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"google.golang.org/grpc/codes"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/flyteorg/flyteadmin/pkg/errors"
)

const gormDescending = "%s desc"
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/impl/util/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ var allowedJoinEntities = map[common.Entity]sets.String{
common.Task: sets.NewString(common.Task),
common.TaskExecution: sets.NewString(common.TaskExecution, common.Task, common.Execution, common.NodeExecution),
common.Workflow: sets.NewString(common.Workflow),
common.NamedEntity: sets.NewString(common.NamedEntity),
common.NamedEntity: sets.NewString(common.NamedEntity, common.NamedEntityMetadata),
common.NamedEntityMetadata: sets.NewString(common.NamedEntityMetadata),
common.Project: sets.NewString(common.Project),
common.Signal: sets.NewString(common.Signal),
Expand Down
11 changes: 0 additions & 11 deletions pkg/repositories/gormimpl/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ package gormimpl

import (
"fmt"
"sync"

"google.golang.org/grpc/codes"
"gorm.io/gorm"
"gorm.io/gorm/schema"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/flyteorg/flyteadmin/pkg/common"
adminErrors "github.com/flyteorg/flyteadmin/pkg/errors"
Expand Down Expand Up @@ -118,11 +115,3 @@ func applyScopedFilters(tx *gorm.DB, inlineFilters []common.InlineFilter, mapFil
}
return tx, nil
}

func modelColumns(v any) sets.String {
s, err := schema.Parse(v, &sync.Map{}, schema.NamingStrategy{})
if err != nil {
panic(err)
}
return sets.NewString(s.DBNames...)
}

0 comments on commit 1df2d18

Please sign in to comment.