danielfrg / s3contents

Jupyter Notebooks in S3 - Jupyter Contents Manager implementation
Apache License 2.0
248 stars 88 forks source link

delete markers cause ghost folders when listing versioned bucket #130

Closed Zhell1 closed 3 years ago

Zhell1 commented 3 years ago

Issue description

s3contents doesn't seem to handle ListObjectsV2 action properly with versioned buckets as it displays all prefixes without making sure if they are delete marker or actual "folders".

Steps to reproduce

Fix hints

(currently working on this, hope to have a PR coming in a few days)

Note: in Minio the versioning is unavailable in a single-disk setup, and requires to deploy in Distributed Mode to use it.

The ListBucketResult returning a KeyCount of 0 might be enough to indicate that the folder is a delete marker and hide it in the filesystem?

<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Name>mybucket</Name>
   <Prefix>myprefix/test/</Prefix>
   <KeyCount>0</KeyCount>
   <MaxKeys>1</MaxKeys>
   <Delimiter>/</Delimiter>
   <IsTruncated>false</IsTruncated>
   <EncodingType>url</EncodingType>
</ListBucketResult>
danielfrg commented 3 years ago

Fixed by https://github.com/danielfrg/s3contents/pull/134