Add support for gzip-compressed CPIO output#2253
Conversation
f692bf1 to
282b5a3
Compare
|
cc: @imjasonh |
Signed-off-by: Lavish Pal <lvishpal408@gmail.com>
282b5a3 to
15aa0c7
Compare
codysoyland
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
Is this needed if you can just run the output to gzip?
Can you include tests?
| return cpio.FromLayer(layer, f) | ||
| if strings.HasSuffix(dest, ".gz") { | ||
| gzw := gzip.NewWriter(f) | ||
| defer gzw.Close() |
There was a problem hiding this comment.
nit: should probably check the error returned by the gzip writer (gzq.Close() writes a footer)
|
implemented based on an existing TODO comment in the codebase "// TODO(mattmoor): Consider wrapping in a gzip writer if the filename ends in Happy to add tests and fix the |
|
also to add some context on the running two separate commands means the full uncompressed output hits disk before being compressed even piping avoids that but still requires gzip to present as a binary which may be not guaranteed on windows or in minimal/distroless build env |
This PR implement support for gzip-compressed CPIO archives when the output filename ends with
.gzDetect
.gzoutput filenames and wrap the destination writer with a gzip writerRan the relevant
go tests