Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
Signed-off-by: shaoting-huang <[email protected]>
  • Loading branch information
shaoting-huang committed Nov 8, 2024
1 parent 85a5083 commit 4cb79b4
Show file tree
Hide file tree
Showing 9 changed files with 1,390 additions and 1,257 deletions.
8 changes: 1 addition & 7 deletions internal/metastore/kv/rootcoord/kv_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -1517,16 +1517,10 @@ func (kc *Catalog) DropPrivilegeGroup(ctx context.Context, groupName string) err
}

func (kc *Catalog) SavePrivilegeGroup(ctx context.Context, data *milvuspb.PrivilegeGroupInfo) error {
// dedup privileges
dedupedMap := lo.SliceToMap(data.Privileges, func(p *milvuspb.PrivilegeEntity) (string, *milvuspb.PrivilegeEntity) {
return p.Name, p
})
dedupedPrivileges := lo.Values(dedupedMap)

k := BuildPrivilegeGroupkey(data.GroupName)
groupInfo := &milvuspb.PrivilegeGroupInfo{
GroupName: data.GroupName,
Privileges: dedupedPrivileges,
Privileges: lo.Uniq(data.Privileges),
}
v, err := proto.Marshal(groupInfo)
if err != nil {
Expand Down
Loading

0 comments on commit 4cb79b4

Please sign in to comment.