mirror of
https://github.com/pgsty/minio.git
synced 2026-10-10 11:46:00 +03:00
ilm: Remove object in HEAD/GET if having an applicable ILM rule (#11296)
Remove an object on the fly if there is a lifecycle rule with delete expiry action for the corresponding object.
This commit is contained in:
+3
-10
@@ -377,21 +377,14 @@ func (s *xlStorage) CrawlAndGetDataUsage(ctx context.Context, cache dataUsageCac
|
||||
}
|
||||
|
||||
var totalSize int64
|
||||
var numVersions = len(fivs.Versions)
|
||||
|
||||
sizeS := sizeSummary{}
|
||||
for i, version := range fivs.Versions {
|
||||
var successorModTime time.Time
|
||||
if i > 0 {
|
||||
successorModTime = fivs.Versions[i-1].ModTime
|
||||
}
|
||||
for _, version := range fivs.Versions {
|
||||
oi := version.ToObjectInfo(item.bucket, item.objectPath())
|
||||
if objAPI != nil {
|
||||
totalSize += item.applyActions(ctx, objAPI, actionMeta{
|
||||
numVersions: numVersions,
|
||||
successorModTime: successorModTime,
|
||||
oi: oi,
|
||||
bitRotScan: healOpts.Bitrot,
|
||||
oi: oi,
|
||||
bitRotScan: healOpts.Bitrot,
|
||||
})
|
||||
item.healReplication(ctx, objAPI, oi, &sizeS)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user