enforceRetentionForDeletion should return false early for delete-marker (#14033)

This commit is contained in:
Harshavardhana
2022-01-05 17:05:28 -08:00
committed by GitHub
parent 557135185c
commit 89441a22aa
2 changed files with 9 additions and 9 deletions

View File

@@ -58,6 +58,10 @@ func (sys *BucketObjectLockSys) Get(bucketName string) (r objectlock.Retention,
// enforceRetentionForDeletion checks if it is appropriate to remove an
// object according to locking configuration when this is lifecycle/ bucket quota asking.
func enforceRetentionForDeletion(ctx context.Context, objInfo ObjectInfo) (locked bool) {
if objInfo.DeleteMarker {
return false
}
lhold := objectlock.GetObjectLegalHoldMeta(objInfo.UserDefined)
if lhold.Status.Valid() && lhold.Status == objectlock.LegalHoldOn {
return true