mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Avoid ILM expiry on deleted versions that are yet to replicate (#18175)
Fixes #18167
This commit is contained in:
@@ -474,7 +474,8 @@ func (api objectAPIHandlers) getObjectHandler(ctx context.Context, objectAPI Obj
|
||||
// Automatically remove the object/version if an expiry lifecycle rule can be applied
|
||||
if lc, err := globalLifecycleSys.Get(bucket); err == nil {
|
||||
rcfg, _ := globalBucketObjectLockSys.Get(bucket)
|
||||
event := evalActionFromLifecycle(ctx, *lc, rcfg, objInfo)
|
||||
replcfg, _ := getReplicationConfig(ctx, bucket)
|
||||
event := evalActionFromLifecycle(ctx, *lc, rcfg, replcfg, objInfo)
|
||||
if event.Action.Delete() {
|
||||
// apply whatever the expiry rule is.
|
||||
applyExpiryRule(event, lcEventSrc_s3GetObject, objInfo)
|
||||
@@ -732,7 +733,8 @@ func (api objectAPIHandlers) headObjectHandler(ctx context.Context, objectAPI Ob
|
||||
// Automatically remove the object/version if an expiry lifecycle rule can be applied
|
||||
if lc, err := globalLifecycleSys.Get(bucket); err == nil {
|
||||
rcfg, _ := globalBucketObjectLockSys.Get(bucket)
|
||||
event := evalActionFromLifecycle(ctx, *lc, rcfg, objInfo)
|
||||
replcfg, _ := getReplicationConfig(ctx, bucket)
|
||||
event := evalActionFromLifecycle(ctx, *lc, rcfg, replcfg, objInfo)
|
||||
if event.Action.Delete() {
|
||||
// apply whatever the expiry rule is.
|
||||
applyExpiryRule(event, lcEventSrc_s3HeadObject, objInfo)
|
||||
|
||||
Reference in New Issue
Block a user