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:
Harshavardhana
2021-08-03 13:26:57 -07:00
committed by GitHub
parent 9371852c7d
commit 035882d292
29 changed files with 204 additions and 631 deletions

View File

@@ -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)
}
}