Skip to content

Commit

Permalink
Change ldap.Search to ldap.SearchWithPaging (goharbor#17534)
Browse files Browse the repository at this point in the history
fixes goharbor#16390

Signed-off-by: stonezdj <[email protected]>

Signed-off-by: stonezdj <[email protected]>
  • Loading branch information
stonezdj authored Sep 19, 2022
1 parent 848167c commit b6c978c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pkg/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"github.com/goharbor/harbor/src/pkg/ldap/model"
)

const pageSize = 1000

// ErrNotFound ...
var ErrNotFound = errors.New("entity not found")

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b6c978c

Please sign in to comment.