Skip to content

Commit c2ddff8

Browse files
nadavMizjackyalbo
authored andcommitted
NSFS | versioning | don't show .versions folder on list-object-versions
Signed-off-by: nadav mizrahi <[email protected]> (cherry picked from commit 5e71305)
1 parent e835894 commit c2ddff8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/sdk/namespace_fs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ class NamespaceFS {
718718
if ((!ent.name.startsWith(prefix_ent) ||
719719
ent.name < marker_curr ||
720720
ent.name === this.get_bucket_tmpdir_name() ||
721-
ent.name === config.NSFS_FOLDER_OBJECT_NAME) &&
722-
!this._is_hidden_version_path(ent.name)) {
721+
ent.name === config.NSFS_FOLDER_OBJECT_NAME) ||
722+
this._is_hidden_version_path(ent.name)) {
723723
return;
724724
}
725725
const isDir = await is_directory_or_symlink_to_directory(ent, fs_context, path.join(dir_path, ent.name));

src/test/unit_tests/test_bucketspace_versioning.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3053,6 +3053,13 @@ mocha.describe('List-objects', function() {
30533053
}
30543054
});
30553055
});
3056+
3057+
mocha.it('list object versions - should not list .versions folder', async function() {
3058+
const res = await s3_client.listObjectVersions({Bucket: bucket_name, Delimiter: "/"});
3059+
res.CommonPrefixes?.forEach(obj => {
3060+
assert.notEqual(obj.Prefix, ".versions/");
3061+
});
3062+
});
30563063
});
30573064

30583065
async function create_object(object_path, data, version_id, return_fd) {

0 commit comments

Comments
 (0)