From c18c6c33b24010b3bfd3c49539f44c49681b4981 Mon Sep 17 00:00:00 2001 From: Thomas Berger Date: Fri, 15 Mar 2019 21:05:21 +0100 Subject: [PATCH] S3 Driver: added comment for missing KeyCount workaround Signed-off-by: Thomas Berger --- registry/storage/driver/s3-aws/s3.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/registry/storage/driver/s3-aws/s3.go b/registry/storage/driver/s3-aws/s3.go index 1f610f796..4b6c50d7b 100644 --- a/registry/storage/driver/s3-aws/s3.go +++ b/registry/storage/driver/s3-aws/s3.go @@ -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