rename Force to Immediate for clarity (#18540)

This commit is contained in:
Anis Eleuch 2023-11-28 22:35:16 -08:00 committed by GitHub
parent e9babf3dac
commit b7d11141e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 69 additions and 68 deletions

View File

@ -232,7 +232,7 @@ func (h *healingTracker) delete(ctx context.Context) error {
pathJoin(bucketMetaPrefix, healingTrackerFilename), pathJoin(bucketMetaPrefix, healingTrackerFilename),
DeleteOptions{ DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}, },
) )
} }

View File

@ -190,7 +190,7 @@ func benchmarkErasureEncode(data, parity, dataDown, parityDown int, size int64,
} }
disk.Delete(context.Background(), "testbucket", "object", DeleteOptions{ disk.Delete(context.Background(), "testbucket", "object", DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
writers[i] = newBitrotWriter(disk, "testbucket", "object", erasure.ShardFileSize(size), DefaultBitrotAlgorithm, erasure.ShardSize()) writers[i] = newBitrotWriter(disk, "testbucket", "object", erasure.ShardFileSize(size), DefaultBitrotAlgorithm, erasure.ShardSize())
} }

View File

@ -273,7 +273,7 @@ func TestListOnlineDisks(t *testing.T) {
tamperedIndex = index tamperedIndex = index
dErr := erasureDisks[index].Delete(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"), DeleteOptions{ dErr := erasureDisks[index].Delete(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if dErr != nil { if dErr != nil {
t.Fatalf("Failed to delete %s - %v", filepath.Join(object, "part.1"), dErr) t.Fatalf("Failed to delete %s - %v", filepath.Join(object, "part.1"), dErr)
@ -455,7 +455,7 @@ func TestListOnlineDisksSmallObjects(t *testing.T) {
tamperedIndex = index tamperedIndex = index
dErr := erasureDisks[index].Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{ dErr := erasureDisks[index].Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if dErr != nil { if dErr != nil {
t.Fatalf("Failed to delete %s - %v", pathJoin(object, xlStorageFormatFile), dErr) t.Fatalf("Failed to delete %s - %v", pathJoin(object, xlStorageFormatFile), dErr)

View File

@ -866,7 +866,7 @@ func (er *erasureObjects) healObjectDir(ctx context.Context, bucket, object stri
defer wg.Done() defer wg.Done()
_ = disk.Delete(ctx, bucket, object, DeleteOptions{ _ = disk.Delete(ctx, bucket, object, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
}(index, disk) }(index, disk)
} }

View File

@ -848,7 +848,7 @@ func TestHealCorrectQuorum(t *testing.T) {
for i := 0; i < nfi.Erasure.ParityBlocks; i++ { for i := 0; i < nfi.Erasure.ParityBlocks; i++ {
erasureDisks[i].Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{ erasureDisks[i].Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
} }
@ -875,7 +875,7 @@ func TestHealCorrectQuorum(t *testing.T) {
for i := 0; i < nfi.Erasure.ParityBlocks; i++ { for i := 0; i < nfi.Erasure.ParityBlocks; i++ {
erasureDisks[i].Delete(context.Background(), minioMetaBucket, pathJoin(cfgFile, xlStorageFormatFile), DeleteOptions{ erasureDisks[i].Delete(context.Background(), minioMetaBucket, pathJoin(cfgFile, xlStorageFormatFile), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
} }
@ -959,7 +959,7 @@ func TestHealObjectCorruptedPools(t *testing.T) {
firstDisk := erasureDisks[0] firstDisk := erasureDisks[0]
err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{ err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if err != nil { if err != nil {
t.Fatalf("Failed to delete a file - %v", err) t.Fatalf("Failed to delete a file - %v", err)
@ -982,7 +982,7 @@ func TestHealObjectCorruptedPools(t *testing.T) {
err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"), DeleteOptions{ err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if err != nil { if err != nil {
t.Errorf("Failure during deleting part.1 - %v", err) t.Errorf("Failure during deleting part.1 - %v", err)
@ -1012,7 +1012,7 @@ func TestHealObjectCorruptedPools(t *testing.T) {
err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"), DeleteOptions{ err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if err != nil { if err != nil {
t.Errorf("Failure during deleting part.1 - %v", err) t.Errorf("Failure during deleting part.1 - %v", err)
@ -1046,7 +1046,7 @@ func TestHealObjectCorruptedPools(t *testing.T) {
for i := 0; i <= nfi.Erasure.DataBlocks; i++ { for i := 0; i <= nfi.Erasure.DataBlocks; i++ {
erasureDisks[i].Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{ erasureDisks[i].Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
} }
@ -1141,7 +1141,7 @@ func TestHealObjectCorruptedXLMeta(t *testing.T) {
err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{ err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if err != nil { if err != nil {
t.Fatalf("Failed to delete a file - %v", err) t.Fatalf("Failed to delete a file - %v", err)
@ -1196,7 +1196,7 @@ func TestHealObjectCorruptedXLMeta(t *testing.T) {
for i := 0; i <= nfi2.Erasure.DataBlocks; i++ { for i := 0; i <= nfi2.Erasure.DataBlocks; i++ {
erasureDisks[i].Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{ erasureDisks[i].Delete(context.Background(), bucket, pathJoin(object, xlStorageFormatFile), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
} }
@ -1296,7 +1296,7 @@ func TestHealObjectCorruptedParts(t *testing.T) {
// Test 1, remove part.1 // Test 1, remove part.1
err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"), DeleteOptions{ err = firstDisk.Delete(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"), DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if err != nil { if err != nil {
t.Fatalf("Failed to delete a file - %v", err) t.Fatalf("Failed to delete a file - %v", err)
@ -1344,7 +1344,7 @@ func TestHealObjectCorruptedParts(t *testing.T) {
err = secondDisk.Delete(context.Background(), bucket, object, DeleteOptions{ err = secondDisk.Delete(context.Background(), bucket, object, DeleteOptions{
Recursive: true, Recursive: true,
Force: false, Immediate: false,
}) })
if err != nil { if err != nil {
t.Fatalf("Failed to delete a file - %v", err) t.Fatalf("Failed to delete a file - %v", err)
@ -1435,7 +1435,7 @@ func TestHealObjectErasure(t *testing.T) {
// Delete the whole object folder // Delete the whole object folder
err = firstDisk.Delete(context.Background(), bucket, object, DeleteOptions{ err = firstDisk.Delete(context.Background(), bucket, object, DeleteOptions{
Recursive: true, Recursive: true,
Force: false, Immediate: false,
}) })
if err != nil { if err != nil {
t.Fatalf("Failed to delete a file - %v", err) t.Fatalf("Failed to delete a file - %v", err)

View File

@ -118,7 +118,7 @@ func (er erasureObjects) removePartMeta(bucket, object, uploadID, dataDir string
g.Go(func() error { g.Go(func() error {
_ = storageDisks[index].Delete(context.TODO(), minioMetaMultipartBucket, curpartPath+".meta", DeleteOptions{ _ = storageDisks[index].Delete(context.TODO(), minioMetaMultipartBucket, curpartPath+".meta", DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
return nil return nil
@ -145,11 +145,11 @@ func (er erasureObjects) removeObjectPart(bucket, object, uploadID, dataDir stri
// the object. The presence of parts that don't belong in the object doesn't affect correctness. // the object. The presence of parts that don't belong in the object doesn't affect correctness.
_ = storageDisks[index].Delete(context.TODO(), minioMetaMultipartBucket, curpartPath, DeleteOptions{ _ = storageDisks[index].Delete(context.TODO(), minioMetaMultipartBucket, curpartPath, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
_ = storageDisks[index].Delete(context.TODO(), minioMetaMultipartBucket, curpartPath+".meta", DeleteOptions{ _ = storageDisks[index].Delete(context.TODO(), minioMetaMultipartBucket, curpartPath+".meta", DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
return nil return nil
@ -185,7 +185,7 @@ func (er erasureObjects) deleteAll(ctx context.Context, bucket, prefix string) {
defer wg.Done() defer wg.Done()
disk.Delete(ctx, bucket, prefix, DeleteOptions{ disk.Delete(ctx, bucket, prefix, DeleteOptions{
Recursive: true, Recursive: true,
Force: false, Immediate: false,
}) })
}(disk) }(disk)
} }
@ -564,7 +564,7 @@ func writeAllDisks(ctx context.Context, disks []StorageAPI, dstBucket, dstEntry
} }
index := index index := index
g.Go(func() error { g.Go(func() error {
return disks[index].Delete(ctx, dstBucket, dstEntry, DeleteOptions{Force: true}) return disks[index].Delete(ctx, dstBucket, dstEntry, DeleteOptions{Immediate: true})
}, index) }, index)
} }
// Ignore these errors. // Ignore these errors.

View File

@ -1772,11 +1772,11 @@ func (er erasureObjects) deletePrefix(ctx context.Context, bucket, prefix string
// - The prefix__XLDIR__ // - The prefix__XLDIR__
defer disks[index].Delete(ctx, bucket, dirPrefix, DeleteOptions{ defer disks[index].Delete(ctx, bucket, dirPrefix, DeleteOptions{
Recursive: true, Recursive: true,
Force: true, Immediate: true,
}) })
return disks[index].Delete(ctx, bucket, prefix, DeleteOptions{ return disks[index].Delete(ctx, bucket, prefix, DeleteOptions{
Recursive: true, Recursive: true,
Force: true, Immediate: true,
}) })
}, index) }, index)
} }

View File

@ -526,7 +526,7 @@ func TestGetObjectNoQuorum(t *testing.T) {
if file != "xl.meta" { if file != "xl.meta" {
disk.Delete(ctx, bucket, pathJoin(object, file), DeleteOptions{ disk.Delete(ctx, bucket, pathJoin(object, file), DeleteOptions{
Recursive: true, Recursive: true,
Force: false, Immediate: false,
}) })
} }
} }
@ -630,7 +630,7 @@ func TestHeadObjectNoQuorum(t *testing.T) {
if file != "xl.meta" { if file != "xl.meta" {
disk.Delete(ctx, bucket, pathJoin(object, file), DeleteOptions{ disk.Delete(ctx, bucket, pathJoin(object, file), DeleteOptions{
Recursive: true, Recursive: true,
Force: false, Immediate: false,
}) })
} }
} }

View File

@ -364,7 +364,7 @@ func saveFormatErasure(disk StorageAPI, format *formatErasureV3, healID string)
// Purge any existing temporary file, okay to ignore errors here. // Purge any existing temporary file, okay to ignore errors here.
defer disk.Delete(context.TODO(), minioMetaBucket, tmpFormat, DeleteOptions{ defer disk.Delete(context.TODO(), minioMetaBucket, tmpFormat, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
// write to unique file. // write to unique file.

View File

@ -24,7 +24,7 @@ import (
// DeleteOptions represents the disk level delete options available for the APIs // DeleteOptions represents the disk level delete options available for the APIs
type DeleteOptions struct { type DeleteOptions struct {
Recursive bool `msg:"r"` Recursive bool `msg:"r"`
Force bool `msg:"f"` Immediate bool `msg:"i"`
} }
//go:generate msgp -file=$GOFILE //go:generate msgp -file=$GOFILE

View File

@ -245,10 +245,10 @@ func (z *DeleteFileHandlerParams) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Opts", "Recursive") err = msgp.WrapError(err, "Opts", "Recursive")
return return
} }
case "f": case "i":
z.Opts.Force, err = dc.ReadBool() z.Opts.Immediate, err = dc.ReadBool()
if err != nil { if err != nil {
err = msgp.WrapError(err, "Opts", "Force") err = msgp.WrapError(err, "Opts", "Immediate")
return return
} }
default: default:
@ -319,14 +319,14 @@ func (z *DeleteFileHandlerParams) EncodeMsg(en *msgp.Writer) (err error) {
err = msgp.WrapError(err, "Opts", "Recursive") err = msgp.WrapError(err, "Opts", "Recursive")
return return
} }
// write "f" // write "i"
err = en.Append(0xa1, 0x66) err = en.Append(0xa1, 0x69)
if err != nil { if err != nil {
return return
} }
err = en.WriteBool(z.Opts.Force) err = en.WriteBool(z.Opts.Immediate)
if err != nil { if err != nil {
err = msgp.WrapError(err, "Opts", "Force") err = msgp.WrapError(err, "Opts", "Immediate")
return return
} }
return return
@ -351,9 +351,9 @@ func (z *DeleteFileHandlerParams) MarshalMsg(b []byte) (o []byte, err error) {
// string "r" // string "r"
o = append(o, 0x82, 0xa1, 0x72) o = append(o, 0x82, 0xa1, 0x72)
o = msgp.AppendBool(o, z.Opts.Recursive) o = msgp.AppendBool(o, z.Opts.Recursive)
// string "f" // string "i"
o = append(o, 0xa1, 0x66) o = append(o, 0xa1, 0x69)
o = msgp.AppendBool(o, z.Opts.Force) o = msgp.AppendBool(o, z.Opts.Immediate)
return return
} }
@ -414,10 +414,10 @@ func (z *DeleteFileHandlerParams) UnmarshalMsg(bts []byte) (o []byte, err error)
err = msgp.WrapError(err, "Opts", "Recursive") err = msgp.WrapError(err, "Opts", "Recursive")
return return
} }
case "f": case "i":
z.Opts.Force, bts, err = msgp.ReadBoolBytes(bts) z.Opts.Immediate, bts, err = msgp.ReadBoolBytes(bts)
if err != nil { if err != nil {
err = msgp.WrapError(err, "Opts", "Force") err = msgp.WrapError(err, "Opts", "Immediate")
return return
} }
default: default:
@ -470,10 +470,10 @@ func (z *DeleteOptions) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Recursive") err = msgp.WrapError(err, "Recursive")
return return
} }
case "f": case "i":
z.Force, err = dc.ReadBool() z.Immediate, err = dc.ReadBool()
if err != nil { if err != nil {
err = msgp.WrapError(err, "Force") err = msgp.WrapError(err, "Immediate")
return return
} }
default: default:
@ -500,14 +500,14 @@ func (z DeleteOptions) EncodeMsg(en *msgp.Writer) (err error) {
err = msgp.WrapError(err, "Recursive") err = msgp.WrapError(err, "Recursive")
return return
} }
// write "f" // write "i"
err = en.Append(0xa1, 0x66) err = en.Append(0xa1, 0x69)
if err != nil { if err != nil {
return return
} }
err = en.WriteBool(z.Force) err = en.WriteBool(z.Immediate)
if err != nil { if err != nil {
err = msgp.WrapError(err, "Force") err = msgp.WrapError(err, "Immediate")
return return
} }
return return
@ -520,9 +520,9 @@ func (z DeleteOptions) MarshalMsg(b []byte) (o []byte, err error) {
// string "r" // string "r"
o = append(o, 0x82, 0xa1, 0x72) o = append(o, 0x82, 0xa1, 0x72)
o = msgp.AppendBool(o, z.Recursive) o = msgp.AppendBool(o, z.Recursive)
// string "f" // string "i"
o = append(o, 0xa1, 0x66) o = append(o, 0xa1, 0x69)
o = msgp.AppendBool(o, z.Force) o = msgp.AppendBool(o, z.Immediate)
return return
} }
@ -550,10 +550,10 @@ func (z *DeleteOptions) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "Recursive") err = msgp.WrapError(err, "Recursive")
return return
} }
case "f": case "i":
z.Force, bts, err = msgp.ReadBoolBytes(bts) z.Immediate, bts, err = msgp.ReadBoolBytes(bts)
if err != nil { if err != nil {
err = msgp.WrapError(err, "Force") err = msgp.WrapError(err, "Immediate")
return return
} }
default: default:

View File

@ -382,7 +382,7 @@ func testStorageAPIDeleteFile(t *testing.T, storage StorageAPI) {
for i, testCase := range testCases { for i, testCase := range testCases {
err := storage.Delete(context.Background(), testCase.volumeName, testCase.objectName, DeleteOptions{ err := storage.Delete(context.Background(), testCase.volumeName, testCase.objectName, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
expectErr := (err != nil) expectErr := (err != nil)

View File

@ -979,7 +979,7 @@ func (p *xlStorageDiskIDCheck) monitorDiskStatus(spent time.Duration) {
} }
err = p.storage.Delete(context.Background(), minioMetaTmpBucket, fn, DeleteOptions{ err = p.storage.Delete(context.Background(), minioMetaTmpBucket, fn, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if err == nil { if err == nil {
t := time.Unix(0, atomic.LoadInt64(&p.health.lastSuccess)) t := time.Unix(0, atomic.LoadInt64(&p.health.lastSuccess))

View File

@ -1109,7 +1109,7 @@ func (s *xlStorage) DeleteVersions(ctx context.Context, volume string, versions
return errs return errs
} }
func (s *xlStorage) moveToTrash(filePath string, recursive, force bool) (err error) { func (s *xlStorage) moveToTrash(filePath string, recursive, immediatePurge bool) (err error) {
pathUUID := mustGetUUID() pathUUID := mustGetUUID()
targetPath := pathutil.Join(s.drivePath, minioMetaTmpDeletedBucket, pathUUID) targetPath := pathutil.Join(s.drivePath, minioMetaTmpDeletedBucket, pathUUID)
@ -1126,6 +1126,7 @@ func (s *xlStorage) moveToTrash(filePath string, recursive, force bool) (err err
} else { } else {
err = Remove(filePath) err = Remove(filePath)
} }
return err // Avoid the immediate purge since not needed
} }
if err != nil { if err != nil {
@ -1133,7 +1134,7 @@ func (s *xlStorage) moveToTrash(filePath string, recursive, force bool) (err err
} }
// immediately purge the target // immediately purge the target
if force { if immediatePurge {
removeAll(targetPath) removeAll(targetPath)
} }
@ -1146,7 +1147,7 @@ func (s *xlStorage) DeleteVersion(ctx context.Context, volume, path string, fi F
if HasSuffix(path, SlashSeparator) { if HasSuffix(path, SlashSeparator) {
return s.Delete(ctx, volume, path, DeleteOptions{ return s.Delete(ctx, volume, path, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
} }
@ -2171,7 +2172,7 @@ func (s *xlStorage) CheckParts(ctx context.Context, volume string, path string,
// move up the tree, deleting empty parent directories until it finds one // move up the tree, deleting empty parent directories until it finds one
// with files in it. Returns nil for a non-empty directory even when // with files in it. Returns nil for a non-empty directory even when
// recursive is set to false. // recursive is set to false.
func (s *xlStorage) deleteFile(basePath, deletePath string, recursive, force bool) error { func (s *xlStorage) deleteFile(basePath, deletePath string, recursive, immediate bool) error {
if basePath == "" || deletePath == "" { if basePath == "" || deletePath == "" {
return nil return nil
} }
@ -2184,7 +2185,7 @@ func (s *xlStorage) deleteFile(basePath, deletePath string, recursive, force boo
var err error var err error
if recursive { if recursive {
err = s.moveToTrash(deletePath, true, force) err = s.moveToTrash(deletePath, true, immediate)
} else { } else {
err = Remove(deletePath) err = Remove(deletePath)
} }
@ -2256,7 +2257,7 @@ func (s *xlStorage) Delete(ctx context.Context, volume string, path string, dele
} }
// Delete file and delete parent directory as well if it's empty. // Delete file and delete parent directory as well if it's empty.
return s.deleteFile(volumeDir, filePath, deleteOpts.Recursive, deleteOpts.Force) return s.deleteFile(volumeDir, filePath, deleteOpts.Recursive, deleteOpts.Immediate)
} }
func skipAccessChecks(volume string) (ok bool) { func skipAccessChecks(volume string) (ok bool) {

View File

@ -892,7 +892,7 @@ func TestXLStorageListDir(t *testing.T) {
if err = xlStorageNew.Delete(context.Background(), "mybucket", "myobject", DeleteOptions{ if err = xlStorageNew.Delete(context.Background(), "mybucket", "myobject", DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}); err != errFileAccessDenied { }); err != errFileAccessDenied {
t.Errorf("expected: %s, got: %s", errFileAccessDenied, err) t.Errorf("expected: %s, got: %s", errFileAccessDenied, err)
} }
@ -902,7 +902,7 @@ func TestXLStorageListDir(t *testing.T) {
// should fail with disk not found. // should fail with disk not found.
err = xlStorageDeletedStorage.Delete(context.Background(), "del-vol", "my-file", DeleteOptions{ err = xlStorageDeletedStorage.Delete(context.Background(), "del-vol", "my-file", DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if err != errDiskNotFound { if err != errDiskNotFound {
t.Errorf("Expected: \"Drive not found\", got \"%s\"", err) t.Errorf("Expected: \"Drive not found\", got \"%s\"", err)
@ -988,7 +988,7 @@ func TestXLStorageDeleteFile(t *testing.T) {
for i, testCase := range testCases { for i, testCase := range testCases {
if err = xlStorage.Delete(context.Background(), testCase.srcVol, testCase.srcPath, DeleteOptions{ if err = xlStorage.Delete(context.Background(), testCase.srcVol, testCase.srcPath, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}); err != testCase.expectedErr { }); err != testCase.expectedErr {
t.Errorf("TestXLStorage case %d: Expected: \"%s\", got: \"%s\"", i+1, testCase.expectedErr, err) t.Errorf("TestXLStorage case %d: Expected: \"%s\", got: \"%s\"", i+1, testCase.expectedErr, err)
} }
@ -1015,7 +1015,7 @@ func TestXLStorageDeleteFile(t *testing.T) {
if err = xlStorageNew.Delete(context.Background(), "mybucket", "myobject", DeleteOptions{ if err = xlStorageNew.Delete(context.Background(), "mybucket", "myobject", DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}); err != errFileAccessDenied { }); err != errFileAccessDenied {
t.Errorf("expected: %s, got: %s", errFileAccessDenied, err) t.Errorf("expected: %s, got: %s", errFileAccessDenied, err)
} }
@ -1036,7 +1036,7 @@ func TestXLStorageDeleteFile(t *testing.T) {
// should fail with disk not found. // should fail with disk not found.
err = xlStorageDeletedStorage.Delete(context.Background(), "del-vol", "my-file", DeleteOptions{ err = xlStorageDeletedStorage.Delete(context.Background(), "del-vol", "my-file", DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
if err != errDiskNotFound { if err != errDiskNotFound {
t.Errorf("Expected: \"Drive not found\", got \"%s\"", err) t.Errorf("Expected: \"Drive not found\", got \"%s\"", err)
@ -1862,7 +1862,7 @@ func TestXLStorageVerifyFile(t *testing.T) {
if err := storage.Delete(context.Background(), volName, fileName, DeleteOptions{ if err := storage.Delete(context.Background(), volName, fileName, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}); err != nil { }); err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@ -64,7 +64,7 @@ func TestUNCPaths(t *testing.T) {
} }
fs.Delete(context.Background(), "voldir", test.objName, DeleteOptions{ fs.Delete(context.Background(), "voldir", test.objName, DeleteOptions{
Recursive: false, Recursive: false,
Force: false, Immediate: false,
}) })
}) })
} }