-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/gitlab: fix GroupSearch() logic
The group search logic didn't consider the fact that the GitLab API returns an alphabetical ordered list of groups within a certain group, thus when multiple subgroups were nested the value groups[0] and list[0] used in the code weren't always the expected ones. With that, instead of looking up for the first group, we look for the last one, meaning that all subgroups found in user's namespace or wherever he has access to, is returned from the API. The match then happens with the group full path or full name, which matches first. In case the user has access to multiple groups with ambiguous names, all possible paths are shown and lab's exits. Signed-off-by: Lucas Zampieri <lzampier@redhat.com> Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
- Loading branch information
Showing
2 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters