fix: versionID and MTime for restored object (#12145)

Signed-off-by: Poorna Krishnamoorthy <poorna@minio.io>
This commit is contained in:
Poorna Krishnamoorthy 2021-04-24 19:04:35 -07:00 committed by GitHub
parent edf7642b0c
commit 5d954ea228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1518,7 +1518,12 @@ func (er erasureObjects) restoreTransitionedObject(ctx context.Context, bucket s
return setRestoreHeaderFn(oi, InvalidObjectState{Bucket: bucket, Object: object}) return setRestoreHeaderFn(oi, InvalidObjectState{Bucket: bucket, Object: object})
} }
_, err = er.CompleteMultipartUpload(ctx, bucket, object, uploadID, uploadedParts, opts) _, err = er.CompleteMultipartUpload(ctx, bucket, object, uploadID, uploadedParts, ObjectOptions{
VersionID: oi.VersionID,
MTime: oi.ModTime,
Versioned: globalBucketVersioningSys.Enabled(bucket),
VersionSuspended: globalBucketVersioningSys.Suspended(bucket),
})
if err != nil { if err != nil {
return setRestoreHeaderFn(oi, toObjectErr(err, minioMetaMultipartBucket, uploadIDPath)) return setRestoreHeaderFn(oi, toObjectErr(err, minioMetaMultipartBucket, uploadIDPath))
} }