mirror of
https://github.com/minio/minio.git
synced 2025-04-07 13:15:39 -04:00
erasure-sd: Evaluate versioning Prefix in multi-delete objects (#15081)
Erasure SD DeleteObjects() is only inheriting bucket versioning status from the handler layer. Add the missing versioning prefix evaluation for each object that will deleted.
This commit is contained in:
parent
f34b2ef90b
commit
14645142db
@ -1203,7 +1203,14 @@ func (es *erasureSingle) DeleteObjects(ctx context.Context, bucket string, objec
|
|||||||
// VersionID is not set means delete is not specific about
|
// VersionID is not set means delete is not specific about
|
||||||
// any version, look for if the bucket is versioned or not.
|
// any version, look for if the bucket is versioned or not.
|
||||||
if objects[i].VersionID == "" {
|
if objects[i].VersionID == "" {
|
||||||
if opts.Versioned || opts.VersionSuspended {
|
// MinIO extension to bucket version configuration
|
||||||
|
suspended := opts.VersionSuspended
|
||||||
|
versioned := opts.Versioned
|
||||||
|
if opts.PrefixEnabledFn != nil {
|
||||||
|
versioned = opts.PrefixEnabledFn(objects[i].ObjectName)
|
||||||
|
}
|
||||||
|
|
||||||
|
if versioned || suspended {
|
||||||
// Bucket is versioned and no version was explicitly
|
// Bucket is versioned and no version was explicitly
|
||||||
// mentioned for deletes, create a delete marker instead.
|
// mentioned for deletes, create a delete marker instead.
|
||||||
vr.ModTime = UTCNow()
|
vr.ModTime = UTCNow()
|
||||||
@ -1211,7 +1218,7 @@ func (es *erasureSingle) DeleteObjects(ctx context.Context, bucket string, objec
|
|||||||
// Versioning suspended means that we add a `null` version
|
// Versioning suspended means that we add a `null` version
|
||||||
// delete marker, if not add a new version for this delete
|
// delete marker, if not add a new version for this delete
|
||||||
// marker.
|
// marker.
|
||||||
if opts.Versioned {
|
if versioned {
|
||||||
vr.VersionID = mustGetUUID()
|
vr.VersionID = mustGetUUID()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user