ilm: Fix cleaning non current null versions (#17876)

This commit is contained in:
Anis Eleuch 2023-08-18 20:55:47 +01:00 committed by GitHub
parent bc7c0d8624
commit 4c6869cd9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1186,10 +1186,10 @@ func applyExpiryOnNonTransitionedObjects(ctx context.Context, objLayer ObjectLay
if lcEvent.Action.DeleteVersioned() {
opts.VersionID = obj.VersionID
}
if opts.VersionID == "" {
opts.Versioned = globalBucketVersioningSys.PrefixEnabled(obj.Bucket, obj.Name)
opts.VersionSuspended = globalBucketVersioningSys.PrefixSuspended(obj.Bucket, obj.Name)
}
opts.Versioned = globalBucketVersioningSys.PrefixEnabled(obj.Bucket, obj.Name)
opts.VersionSuspended = globalBucketVersioningSys.PrefixSuspended(obj.Bucket, obj.Name)
if lcEvent.Action.DeleteAll() {
opts.DeletePrefix = true
}