mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
lifecycle: Expiry should not delete versions (#9972)
Currently, lifecycle expiry is deleting all object versions which is not correct, unless noncurrent versions field is specified. Also, only delete the delete marker if it is the only version of the given object.
This commit is contained in:
@@ -408,7 +408,7 @@ func (s *xlStorage) CrawlAndGetDataUsage(ctx context.Context, cache dataUsageCac
|
||||
|
||||
var totalSize int64
|
||||
for _, version := range fivs.Versions {
|
||||
size := item.applyActions(ctx, objAPI, actionMeta{oi: version.ToObjectInfo(item.bucket, item.objectPath())})
|
||||
size := item.applyActions(ctx, objAPI, actionMeta{numVersions: len(fivs.Versions), oi: version.ToObjectInfo(item.bucket, item.objectPath())})
|
||||
if !version.Deleted {
|
||||
totalSize += size
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user