Open
Description
Required information
- Distribution: Snap
- Distribution version: 6.21
Issue description
The image export endpoint GET 1.0/images/:id/export
is returning an inconsistent format:
- If the image is unified, the endpoint returns a stream with a tar.gz file.
- If the image is split, the endpoint returns a multipart stream with two files in it. The stream is named "export" on the client side when downloaded.
I suggest in the 2nd case to pack the two files into one tar archive and stream that archive as a single file download. The tar archive can be properly named after the image (like in the 1st case) and inspected with standard archive tools by the user.
To be backwards compatible the change in semantics of the endpoint will only take effect, when a flag is set, I propose GET 1.0/images/:id/export?single-file-download
.
Additionally, it would be nice if the image upload endpoint PUT 1.0/images
will be extended, so it also accepts the single file tar export created above.
Steps to reproduce
- start an instance from a remote image to ensure a remote image is present
- Call the GET 1.0/images/:id/export endpoint on the now cached image. This will produce a multipart stream. If you look closely after download (i.e. with less) at the download artefact, you can see it consistes of two files which are not packed in a easy to read way for the user.
Activity