S3 Driver: added comment for missing KeyCount workaround

Signed-off-by: Thomas Berger <loki@lokis-chaos.de>
This commit is contained in:
Thomas Berger 2019-03-15 21:05:21 +01:00
parent f877726503
commit c18c6c33b2

View file

@ -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 { listObjectErr := d.S3.ListObjectsV2PagesWithContext(ctx, listObjectsInput, func(objects *s3.ListObjectsV2Output, lastPage bool) bool {
var count int64 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 { if objects.KeyCount != nil {
count = *objects.KeyCount count = *objects.KeyCount
*objectCount += *objects.KeyCount *objectCount += *objects.KeyCount