ignore remove errors for WORM protected objects (#4111)

this error is similar to insufficient permission
on local folders, we can proceed to remove whatever
objects we can.
This commit is contained in:
Harshavardhana
2022-06-10 15:12:16 -07:00
committed by GitHub
parent d42880acb1
commit 50669cafa6
+5 -1
View File
@@ -536,10 +536,14 @@ func listAndRemove(url string, opts removeOpts) error {
if result.Err != nil {
errorIf(result.Err.Trace(path),
"Failed to remove `"+path+"`.")
switch result.Err.ToGoError().(type) {
switch e := result.Err.ToGoError().(type) {
case PathInsufficientPermission:
// Ignore Permission error.
continue
case minio.ErrorResponse:
if strings.Contains(e.Message, "Object is WORM protected and cannot be overwritten") {
continue
}
}
close(contentCh)
return exitStatus(globalErrorExitStatus)