Skip to content

Commit

Permalink
S3 Driver: added comment for missing KeyCount workaround
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Berger <loki@lokis-chaos.de>
Signed-off-by: wang yan <wangyan@vmware.com>
  • Loading branch information
tbe authored and wy65701436 committed Mar 10, 2020
1 parent 0a1e4a5 commit e2f006a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions registry/storage/driver/s3-aws/s3.go
Expand Up @@ -971,6 +971,9 @@ func (d *driver) doWalk(parentCtx context.Context, objectCount *int64, path, pre
listObjectErr := d.S3.ListObjectsV2PagesWithContext(ctx, listObjectsInput, func(objects *s3.ListObjectsV2Output, lastPage bool) bool {

var count int64
// KeyCount was introduced with version 2 of the GET Bucket operation in S3.
// Some S3 implementations don't support V2 now, so we fall back to manual
// calculation of the key count if required
if objects.KeyCount != nil {
count = *objects.KeyCount
*objectCount += *objects.KeyCount
Expand Down

0 comments on commit e2f006a

Please sign in to comment.