Support configuring the compression level when archiving bundles #3101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change
This adds an extra command line flag for the
archive
command that allows configuring the level of compression to use when creating the gzipped tar archive.If the flag is omitted the gzipped tar archive will be compressed with
DefaultCompression
- this is equivalent to the pre-configurable-compression behavior of Porter.Possible values for the
--compression
flag is listed in the help text.$ porter archive -h [snipped] Flags: -c, --compression string Compression level to use when creating the gzipped tar archive. Allowed values are: BestCompression, BestSpeed, DefaultCompression, HuffmanOnly, NoCompression (default "DefaultCompression")
publish
appears to not care about the compression level of the gzipped tar archive.What issue does it fix
Closes #3083
Notes for the reviewer
I opted to expose all compression levels for the
gzip/flate
go module - keeping the case intact. We can elect to exclude some and/or adjust the casing.Checklist