satellite/metainfo: set list cursor to version 1
Otherwise, if left to default version 0, the iterator will include the cursor item in the result, which fails some tests. Change-Id: I85103a36852477f371ec46c673a82c2e129978b7
This commit is contained in:
parent
efaba85c73
commit
67c210a64c
@ -977,10 +977,13 @@ func (endpoint *Endpoint) ListObjects(ctx context.Context, req *pb.ObjectListReq
|
|||||||
ProjectID: keyInfo.ProjectID,
|
ProjectID: keyInfo.ProjectID,
|
||||||
BucketName: string(req.Bucket),
|
BucketName: string(req.Bucket),
|
||||||
Prefix: prefix,
|
Prefix: prefix,
|
||||||
Cursor: metabase.IterateCursor{Key: metabase.ObjectKey(req.EncryptedCursor)},
|
Cursor: metabase.IterateCursor{
|
||||||
Recursive: req.Recursive,
|
Key: metabase.ObjectKey(req.EncryptedCursor),
|
||||||
BatchSize: limit + 1,
|
Version: 1, // TODO: set to a the version from the protobuf request when it supports this
|
||||||
Status: status,
|
},
|
||||||
|
Recursive: req.Recursive,
|
||||||
|
BatchSize: limit + 1,
|
||||||
|
Status: status,
|
||||||
}, func(ctx context.Context, it metabase.ObjectsIterator) error {
|
}, func(ctx context.Context, it metabase.ObjectsIterator) error {
|
||||||
entry := metabase.ObjectEntry{}
|
entry := metabase.ObjectEntry{}
|
||||||
for len(resp.Items) < limit && it.Next(ctx, &entry) {
|
for len(resp.Items) < limit && it.Next(ctx, &entry) {
|
||||||
|
Loading…
Reference in New Issue
Block a user