rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
463 stars 262 forks source link

User not suggested when linking to a project / namespace #12358

Open mmartin24 opened 1 month ago

mmartin24 commented 1 month ago

Setup

Describe the bug After creating a user, when I attempt to link him/her to a project the username is not suggested; I have to type a few letters until it appears.

To Reproduce

Result

Expected Result A created user should be suggested without the need of typing

Screenshots

Additional context

weyfonk commented 1 month ago

We've also noticed that no suggestions appear until one types a username. Typing a user's display name does not lead to suggestions being shown based on that name.

richard-cox commented 1 month ago

This would be more of an enhancement than a bug.

Members added to global, cluster or namespace roles all use the same component and revolve around selecting a principal (rather than user or group). Membership is then created as a binding linking a role and a principal.

There could be 10k+ principles (think corporate active directory) so the ui calls a specific search endpoint which does some smarts and throttling on counts (/v3/principals?action=search).

An improvement could be for the ui to search for an empty string, but have a feeling that might not work. Needs investigating.

richard-cox commented 1 month ago

@weyfonk i could not reproduce failure to find a user by searching for their display name. For instance a local user with name aaa and display name of bbb would be returned when searching for bbb. Could you open a new issue and provide steps to reproduce, specifically including any details on external auth provider?

weyfonk commented 1 month ago

Oh, I've tried again and it seems that one must type a minimum of 2 chars for a search to begin. Following your example, typing b would not yield results, but bb would. The search is case-sensitive too. That isn't documented here yet. The same seems to apply to adding users to clusters; the same UI component is probably involved. I'll submit a PR to rancher/rancher-docs.

Thanks!