mirror of
https://github.com/minio/minio.git
synced 2026-02-12 22:00:16 -05:00
fix: do not list delete-marked objects (#13864)
delete marked objects should not be considered for listing when listing is delimited, this issue as introduced in PR #13804 which was mainly to address listing of directories in listing when delimited. This PR fixes this properly and adds tests to ensure that we behave in accordance with how an S3 API behaves for ListObjects() without versions.
This commit is contained in:
@@ -42,6 +42,8 @@ func testListObjectsVersionedFolders(obj ObjectLayer, instanceType string, t1 Te
|
||||
testBuckets := []string{
|
||||
// This bucket is used for testing ListObject operations.
|
||||
"test-bucket-folders",
|
||||
// This bucket has file delete marker.
|
||||
"test-bucket-files",
|
||||
}
|
||||
for _, bucket := range testBuckets {
|
||||
err := obj.MakeBucketWithLocation(context.Background(), bucket, BucketOptions{
|
||||
@@ -62,6 +64,7 @@ func testListObjectsVersionedFolders(obj ObjectLayer, instanceType string, t1 Te
|
||||
}{
|
||||
{testBuckets[0], "unique/folder/", "", nil, true},
|
||||
{testBuckets[0], "unique/folder/1.txt", "content", nil, false},
|
||||
{testBuckets[1], "unique/folder/1.txt", "content", nil, true},
|
||||
}
|
||||
for _, object := range testObjects {
|
||||
md5Bytes := md5.Sum([]byte(object.content))
|
||||
@@ -102,6 +105,10 @@ func testListObjectsVersionedFolders(obj ObjectLayer, instanceType string, t1 Te
|
||||
{Name: "unique/folder/1.txt"},
|
||||
},
|
||||
},
|
||||
{
|
||||
IsTruncated: false,
|
||||
Objects: []ObjectInfo{},
|
||||
},
|
||||
}
|
||||
|
||||
testCases := []struct {
|
||||
@@ -120,6 +127,7 @@ func testListObjectsVersionedFolders(obj ObjectLayer, instanceType string, t1 Te
|
||||
{testBuckets[0], "unique/", "", "/", 1000, resultCases[0], nil, true},
|
||||
{testBuckets[0], "unique/folder", "", "/", 1000, resultCases[0], nil, true},
|
||||
{testBuckets[0], "unique/", "", "", 1000, resultCases[1], nil, true},
|
||||
{testBuckets[1], "unique/folder/", "", "/", 1000, resultCases[2], nil, true},
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
|
||||
Reference in New Issue
Block a user