data source GitLab User: return exact matching user if attributes match
When we use the data source gitlab_user we run into the issue that the exact searched user is not returned if multiple user match the search.
Given: two existing users with email:
a.lastname@example.comaaa.lastname@example.com
using the resource gitlab_user like this:
data "gitlab_user" "a.lastname" {
email = "a.lastname@example.com"
}
will result in an info message:
more than one user found matching. Will return the first user, since this can only happen when using
search
This change will enable the data source to return the desired user as there is an exact match for the provided email attribute without issuing unnecessary info messages.
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
Edited by Ricardo Bartels