mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-27 13:02:59 +02:00
Change ldap.Search to ldap.SearchWithPaging (#17534)
fixes #16390 Signed-off-by: stonezdj <stonezdj@gmail.com> Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
parent
848167c4e0
commit
b6c978c7f7
@ -30,6 +30,8 @@ import (
|
||||
"github.com/goharbor/harbor/src/pkg/ldap/model"
|
||||
)
|
||||
|
||||
const pageSize = 1000
|
||||
|
||||
// ErrNotFound ...
|
||||
var ErrNotFound = errors.New("entity not found")
|
||||
|
||||
@ -267,7 +269,7 @@ func (s *Session) SearchLdapAttribute(baseDN, filter string, attributes []string
|
||||
nil,
|
||||
)
|
||||
|
||||
result, err := s.ldapConn.Search(searchRequest)
|
||||
result, err := s.ldapConn.SearchWithPaging(searchRequest, pageSize)
|
||||
if result != nil {
|
||||
log.Debugf("Found entries:%v\n", len(result.Entries))
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user