Skip to content

Commit e40c9c2

Browse files
author
Jordan Caussat
committed
Update data source users: improve id hash using separators
1 parent 878115b commit e40c9c2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gitlab/data_source_gitlab_users.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,36 +182,43 @@ func expandGitlabUsersOptions(d *schema.ResourceData) (*gitlab.ListUsersOptions,
182182
listUsersOptions.OrderBy = &orderBy
183183
optionsHash += orderBy
184184
}
185+
optionsHash += ","
185186
if data, ok := d.GetOk("sort"); ok {
186187
sort := data.(string)
187188
listUsersOptions.Sort = &sort
188189
optionsHash += sort
189190
}
191+
optionsHash += ","
190192
if data, ok := d.GetOk("search"); ok {
191193
search := data.(string)
192194
listUsersOptions.Search = &search
193195
optionsHash += search
194196
}
197+
optionsHash += ","
195198
if data, ok := d.GetOk("active"); ok {
196199
active := data.(bool)
197200
listUsersOptions.Active = &active
198201
optionsHash += strconv.FormatBool(active)
199202
}
203+
optionsHash += ","
200204
if data, ok := d.GetOk("blocked"); ok {
201205
blocked := data.(bool)
202206
listUsersOptions.Blocked = &blocked
203207
optionsHash += strconv.FormatBool(blocked)
204208
}
209+
optionsHash += ","
205210
if data, ok := d.GetOk("identities_extern_uid"); ok {
206211
externalUID := data.(string)
207212
listUsersOptions.ExternalUID = &externalUID
208213
optionsHash += externalUID
209214
}
215+
optionsHash += ","
210216
if data, ok := d.GetOk("identities_provider"); ok {
211217
provider := data.(string)
212218
// listUsersOptions.Provider = &provider
213219
optionsHash += provider
214220
}
221+
optionsHash += ","
215222
if data, ok := d.GetOk("created_before"); ok {
216223
createdBefore := data.(string)
217224
date, err := time.Parse("2006-01-02", createdBefore)
@@ -221,6 +228,7 @@ func expandGitlabUsersOptions(d *schema.ResourceData) (*gitlab.ListUsersOptions,
221228
listUsersOptions.CreatedBefore = &date
222229
optionsHash += createdBefore
223230
}
231+
optionsHash += ","
224232
if data, ok := d.GetOk("created_after"); ok {
225233
createdAfter := data.(string)
226234
// date, err := time.Parse("2006-01-02", createdAfter)

0 commit comments

Comments
 (0)