Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize queries #251

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

Gentleelephant
Copy link
Collaborator

No description provided.

Signed-off-by: Gentleelephant <moon0hello@gmail.com>
if !ok {
array = make(map[string]string)
}
array[user] = ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user 用map[string]string 存有必要吗? value 里面除了"" 还会存什么?

make(map[string]map[string]string):
map[namespace]map[user]""

user 直接是个 string 会有什么问题?影响之前的代码?
make(map[string]string)
map[namespace]user

@wanjunlei @Gentleelephant

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一个 ns 会有多个 user 有权限访问,用 map 存 user 是为了提高查询效率

@benjaminhuo benjaminhuo merged commit c8ea398 into kubesphere:master Mar 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants