mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: remove parentIsObject() check (#12851)
we will allow situations such as ``` a/b/1.txt a/b ``` and ``` a/b a/b/1.txt ``` we are going to document that this usecase is not supported and we will never support it, if any application does this users have to delete the top level parent to make sure namespace is accessible at lower level. rest of the situations where the prefixes get created across sets are supported as is.
This commit is contained in:
@@ -1628,8 +1628,8 @@ func TestXLStorageRenameFile(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestXLStorage xlStorage.CheckFile()
|
||||
func TestXLStorageCheckFile(t *testing.T) {
|
||||
// TestXLStorage xlStorage.StatInfoFile()
|
||||
func TestXLStorageStatInfoFile(t *testing.T) {
|
||||
// create xlStorage test setup
|
||||
xlStorage, path, err := newXLStorageTestSetup()
|
||||
if err != nil {
|
||||
@@ -1699,19 +1699,20 @@ func TestXLStorageCheckFile(t *testing.T) {
|
||||
{
|
||||
srcVol: "non-existent-vol",
|
||||
srcPath: "success-file",
|
||||
expectedErr: errPathNotFound,
|
||||
expectedErr: errVolumeNotFound,
|
||||
},
|
||||
// TestXLStorage case - 7.
|
||||
// TestXLStorage case with file with directory.
|
||||
{
|
||||
srcVol: "success-vol",
|
||||
srcPath: "path/to",
|
||||
expectedErr: errFileNotFound,
|
||||
expectedErr: nil,
|
||||
},
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
if err := xlStorage.CheckFile(context.Background(), testCase.srcVol, testCase.srcPath); err != testCase.expectedErr {
|
||||
_, err := xlStorage.StatInfoFile(context.Background(), testCase.srcVol, testCase.srcPath+"/"+xlStorageFormatFile)
|
||||
if err != testCase.expectedErr {
|
||||
t.Errorf("TestXLStorage case %d: Expected: \"%s\", got: \"%s\"", i+1, testCase.expectedErr, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user