Conversation
|
|
||
| // ImageSaveOptions provide options for saving images. | ||
| type ImageSaveOptions struct { | ||
| // |
| succeeded = false | ||
| ) | ||
| // If --zip is used, we need to manually create a writer that gzips the content. | ||
| if saveOpts.Zip { |
There was a problem hiding this comment.
This feels like it should be integrated with the handling of the output flag - right now it feels like it duplicates a lot of that
Luap99
left a comment
There was a problem hiding this comment.
Not a proper review but design wise I am not sure why we would call this --zip when it uses gzip. Also generally speaking I am not sure we would want lock us into a specific format like that. Other commands support --compression-format so that seem like a better option to be consistent and support multiple formats.
Then the other thing implementing this here on the client side via pipe adds exactly nothing over just having the user pipe it themselves performance wise so IMO like that there is no benefit on doing this at all.
Instead it would be better IMO to have this compression done server side so in case of podman-remote so we do not have to transfer everything uncompressed. And it would give HTTP API users the option to use it as well. Also when we do it at the source we can directly compress without copying the full stream again through the pipes
|
Part of opening this was to start a discussion on the feasibility of a feature like this. My code in my MR is a proof of concept and I'm absolutely open to ideas on how to make it more compatible with the rest of podman. This is also my first contribution to a larger project so I'm still learning my way around this. |
This is my first Pull Request to a larger project, so please let me know if I'm doing something incorrect!
Fixes #28420
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
podman savenow allows for the user to use--zipto directly write to a.tar.gzfile instead of having to pipe this into gzip.Before:
Now:
(Working on adding a feature to auto-name the output file)