Skip to content

Commit

Permalink
Merge pull request #8273 from nadavMiz/remove-versions-folder-from-list
Browse files Browse the repository at this point in the history
NSFS | versioning | don't show .versions folder on list-object-versions
  • Loading branch information
nadavMiz authored Aug 13, 2024
2 parents a72063b + 5e71305 commit a2992c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sdk/namespace_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ class NamespaceFS {
if ((!ent.name.startsWith(prefix_ent) ||
ent.name < marker_curr ||
ent.name === this.get_bucket_tmpdir_name() ||
ent.name === config.NSFS_FOLDER_OBJECT_NAME) &&
!this._is_hidden_version_path(ent.name)) {
ent.name === config.NSFS_FOLDER_OBJECT_NAME) ||
this._is_hidden_version_path(ent.name)) {
return;
}
const isDir = await is_directory_or_symlink_to_directory(ent, fs_context, path.join(dir_path, ent.name));
Expand Down
7 changes: 7 additions & 0 deletions src/test/unit_tests/test_bucketspace_versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -3053,6 +3053,13 @@ mocha.describe('List-objects', function() {
}
});
});

mocha.it('list object versions - should not list .versions folder', async function() {
const res = await s3_client.listObjectVersions({Bucket: bucket_name, Delimiter: "/"});
res.CommonPrefixes?.forEach(obj => {
assert.notEqual(obj.Prefix, ".versions/");
});
});
});

async function create_object(object_path, data, version_id, return_fd) {
Expand Down

0 comments on commit a2992c0

Please sign in to comment.