Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support configuring the compression level when archiving bundles #3101

Merged

Conversation

jarnfast
Copy link
Contributor

@jarnfast jarnfast commented May 7, 2024

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.

$ porter archive whalegap.tgz --reference ghcr.io/getporter/examples/whalegap:v0.2.0 --compression NoCompression

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

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list.

Signed-off-by: Jens Arnfast <jens@arnfast.net>
Copy link
Member

@schristoff schristoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All checks based, tests written, this is beautiful :)
Thank you

@schristoff schristoff merged commit afa0ba3 into getporter:main May 8, 2024
15 checks passed
@jarnfast jarnfast deleted the feature/configurable-archive-compression branch May 8, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional gzipping when using porter archive
2 participants