Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minio Cataloger - fix List call - token should be on 3. position #1212

Merged
merged 2 commits into from
May 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions pkg/storage/minio/cataloger.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ func (s *storageImpl) Catalog(ctx context.Context, token string, pageSize int) (
const op errors.Op = "minio.Catalog"
ctx, span := observ.StartSpan(ctx, op.String())
defer span.End()
queryToken := token
res := make([]paths.AllPathParams, 0)
startAfter := token
token = ""

count := pageSize
for count > 0 {
loo, err := s.minioCore.ListObjectsV2(s.bucketName, token, "", false, "", 0, startAfter)
loo, err := s.minioCore.ListObjectsV2(s.bucketName, "", token, false, "", 0, "")
if err != nil {
return nil, "", errors.E(op, err)
}
Expand All @@ -33,17 +29,16 @@ func (s *storageImpl) Catalog(ctx context.Context, token string, pageSize int) (

res = append(res, m...)
count -= len(m)
queryToken = lastKey

token = lastKey
if !loo.IsTruncated { // not truncated, there is no point in asking more
if count > 0 { // it means we reached the end, no subsequent requests are necessary
queryToken = ""
token = ""
}
break
}
}

return res, queryToken, nil
return res, token, nil
}

func fetchModsAndVersions(objects []minio.ObjectInfo, elementsNum int) ([]paths.AllPathParams, string) {
Expand Down