mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
allow deletes on directory objects to perform permanent deletes (#17132)
This commit is contained in:
@@ -174,6 +174,11 @@ func delOpts(ctx context.Context, r *http.Request, bucket, object string) (opts
|
||||
// benefits of replication, make sure to apply version suspension
|
||||
// only at bucket level instead.
|
||||
opts.VersionSuspended = globalBucketVersioningSys.Suspended(bucket)
|
||||
// For directory objects, delete `null` version permanently.
|
||||
if isDirObject(object) && opts.VersionID == "" {
|
||||
opts.VersionID = nullVersionID
|
||||
}
|
||||
|
||||
delMarker := strings.TrimSpace(r.Header.Get(xhttp.MinIOSourceDeleteMarker))
|
||||
if delMarker != "" {
|
||||
switch delMarker {
|
||||
@@ -321,9 +326,16 @@ func putOpts(ctx context.Context, r *http.Request, bucket, object string, metada
|
||||
if err != nil {
|
||||
return opts, err
|
||||
}
|
||||
|
||||
opts.VersionID = vid
|
||||
opts.Versioned = versioned
|
||||
opts.VersionSuspended = versionSuspended
|
||||
|
||||
// For directory objects skip creating new versions.
|
||||
if isDirObject(object) && vid == "" {
|
||||
opts.VersionID = nullVersionID
|
||||
}
|
||||
|
||||
opts.MTime = mtime
|
||||
opts.ReplicationSourceLegalholdTimestamp = lholdtimestmp
|
||||
opts.ReplicationSourceRetentionTimestamp = retaintimestmp
|
||||
|
||||
Reference in New Issue
Block a user