Skip to content

Commit

Permalink
fix List call - token should be on 3. position (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
marpio authored and arschles committed May 9, 2019
1 parent 0cac0ed commit b2bcdce
Showing 1 changed file with 4 additions and 9 deletions.
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

0 comments on commit b2bcdce

Please sign in to comment.