[#170] Support tar.gz archives downloading #177
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-http-gw#177
Loading…
Reference in a new issue
No description provided.
Delete branch "nzinkevich/frostfs-http-gw:tar_download"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add handler DownloadTar for downloading tar.gz archives with objects by prefix (same as
zip
). Make methods more universal for using in both implementations[#170] Support downloading tar.gz archiveto [#170] Support tar.gz archives downloading@ -130,2 +130,2 @@
// Zip compression.
cfgZipCompression = "zip.compression"
// Archive compression.
cfgArchiveCompression = "archive.compression"
I'm not sure if we can remove
zip.compression
parameter. Probably we should keep it for one release.cc @alexvanin
@ -65,0 +61,4 @@
| Common headers | See [bearer token](#bearer-token). |
| `X-Attribute-System-*` | Used to set system FrostFS object attributes <br/> (e.g. use "X-Attribute-System-Expiration-Epoch" to set `__SYSTEM__EXPIRATION_EPOCH` attribute). |
| `X-Attribute-*` | Used to set regular object attributes <br/> (e.g. use "X-Attribute-My-Tag" to set `My-Tag` attribute). |
| `X-Attribute-Explode-Archive` | If this header is set, gate reads files from uploaded `tar.gz` archive and creates object for each file in it. Set FilePath attribute as relative path from archive root. |
This should be
X-Explode-Archive
@ -115,3 +140,1 @@
c.Response.Header.Set(fasthttp.HeaderContentType, "application/zip")
c.Response.Header.Set(fasthttp.HeaderContentDisposition, "attachment; filename=\"archive.zip\"")
c.Response.SetStatusCode(http.StatusOK)
c.Response.Header.Set(fasthttp.HeaderContentType, "application/x-gzip")
Shouldn't it be
application/x-gtar
?https://en.wikipedia.org/wiki/List_of_archive_formats
@ -165,1 +197,3 @@
}
func (h *Handler) putObjectToArchive(ctx context.Context, log *zap.Logger, cnrID cid.ID, bufZip *[]byte, createArchiveHeader func(obj *object.Object) (io.Writer, error)) func(id oid.ID) bool {
return func(id oid.ID) bool {
log := log.With(zap.String("oid", id.EncodeToString()))
Should be
@ -86,2 +88,4 @@
}
if header := c.Request.Header.Peek(utils.UserAttributeHeaderPrefix + explodeArchiveHeader); header != nil {
h.explodeGzip(c, log, bktInfo, file)
Is this different from #176 ?
If no than we should either:
If yes than why do we ever need #176 ?
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.