fix(ilm): expire a restored copy by the version it belongs to

Signed-off-by: Denis Babchuk <babchukdenis@icloud.com>
This commit is contained in:
Denis Babchuk
2026-11-02 21:41:37 +03:00
parent 0fc5a0b527
commit 001078e9ca
2 changed files with 462 additions and 0 deletions
+11
View File
@@ -622,6 +622,17 @@ func expireTransitionedObject(ctx context.Context, objectAPI ObjectLayer, oi *Ob
// delete locally restored copy of object or object version
// from the source, while leaving metadata behind. The data on
// transitioned tier lies untouched and still accessible
//
// The restored copy belongs to this version, also when it is the
// latest one (DeleteRestoredAction). Without its version ID the
// delete applies to the object: a versioned bucket gets a delete
// marker that hides it, a suspended one strips the null version.
// An empty version ID is the null version, as callers that read
// it without the versioning of the bucket leave it.
opts.VersionID = oi.VersionID
if opts.VersionID == "" {
opts.VersionID = nullVersionID
}
opts.Transition.ExpireRestored = true
_, err := objectAPI.DeleteObject(ctx, oi.Bucket, oi.Name, opts)
if err == nil {