tar: Avoid storing snowball extraction header in extract objects (#17389)

This commit is contained in:
Anis Eleuch 2023-06-12 17:42:06 +01:00 committed by GitHub
parent 6f2406b0b6
commit 0f0dcf0c5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -2106,7 +2106,19 @@ func (api objectAPIHandlers) PutObjectExtractHandler(w http.ResponseWriter, r *h
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
return
}
metadata[xhttp.AmzStorageClass] = sc
// Remove the snowball headers from metadata from objects
// since those are actionable headers and not for storage
delete(metadata, xhttp.AmzSnowballExtract)
delete(metadata, xhttp.AmzSnowballExtract)
delete(metadata, xhttp.MinIOSnowballIgnoreDirs)
delete(metadata, xhttp.MinIOSnowballIgnoreErrors)
delete(metadata, xhttp.MinIOSnowballPrefix)
// Use the same storage class as the original uploaded tar file
if sc != "" {
metadata[xhttp.AmzStorageClass] = sc
}
putObjectTar := func(reader io.Reader, info os.FileInfo, object string) error {
size := info.Size()

View File

@ -89,8 +89,9 @@ const (
AmzObjectLockLegalHold = "X-Amz-Object-Lock-Legal-Hold"
AmzObjectLockBypassGovernance = "X-Amz-Bypass-Governance-Retention"
AmzBucketReplicationStatus = "X-Amz-Replication-Status"
AmzSnowballExtract = "X-Amz-Meta-Snowball-Auto-Extract"
// AmzSnowballExtract will trigger unpacking of an archive content
AmzSnowballExtract = "X-Amz-Meta-Snowball-Auto-Extract"
// MinIOSnowballIgnoreDirs will skip creating empty directory objects.
MinIOSnowballIgnoreDirs = "X-Amz-Meta-Minio-Snowball-Ignore-Dirs"
// MinIOSnowballIgnoreErrors will ignore recoverable errors, typically single files failing to upload.