solo-io / packer-plugin-arm-image

Packer plugin for ARM images
Apache License 2.0
426 stars 104 forks source link

Fix 'file already closed' error for compressed images #137

Closed will-dee closed 2 years ago

will-dee commented 2 years ago

When unpacking compressed images that are not compressed as zip archives (e.g. gzip, xz) the image would unpack nearly all of the way and then would fail with an error like: 'read |0: file already closed' as is documented in GitHub issue 61.

As the decompression is offloaded to an external tool for these compression types and the data is streamed through a reader and writer in order to allow reporting on progress, we ensure that the exec.Cmd instance for the external decompression tool is not torn down until the associated reader is closed. The docs for Cmd.StdoutPipe explain this in more detail.

solo-build-bot[bot] commented 2 years ago

Waiting for approval from someone in the solo-io org to start testing.