Fix retention enforcement check for deleted object versions (#13240)

if an object is pending version purge, it should be treated
as ErrNone in retention enforcement check
This commit is contained in:
Poorna Krishnamoorthy 2021-09-17 18:21:24 -04:00 committed by GitHub
parent 6d42569ade
commit 18f008f7c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ func enforceRetentionBypassForDelete(ctx context.Context, r *http.Request, bucke
if gerr != nil { // error from GetObjectInfo
switch gerr.(type) {
case MethodNotAllowed: // This happens usually for a delete marker
if oi.DeleteMarker {
if oi.DeleteMarker || !oi.VersionPurgeStatus.Empty() {
// Delete marker should be present and valid.
return ErrNone
}