Respect compression_format from containers.conf in push, build --cache-to, and commit#6757
Respect compression_format from containers.conf in push, build --cache-to, and commit#6757Honny1 wants to merge 5 commits intocontainers:mainfrom
compression_format from containers.conf in push, build --cache-to, and commit#6757Conversation
|
While fixing the build cache, I decided to also check the pull and commit where compression is used. |
4ce00cc to
b66921a
Compare
|
Ephemeral COPR build failed. @containers/packit-build please check. |
|
/packit rebuild-failed |
|
PTAL @containers/buildah-maintainers |
| if defaultContainerConfig.Engine.CompressionLevel != nil { | ||
| compressionLevel = defaultContainerConfig.Engine.CompressionLevel | ||
| } |
There was a problem hiding this comment.
| if defaultContainerConfig.Engine.CompressionLevel != nil { | |
| compressionLevel = defaultContainerConfig.Engine.CompressionLevel | |
| } | |
| compressionLevel = defaultContainerConfig.Engine.CompressionLevel |
Definitely non-blocking, it just caught my eye, but the if is redundant, right? compressionLevel would be nil on declaration, so assigning nil to it again would not be a problem.
|
LGTM |
nalind
left a comment
There was a problem hiding this comment.
What's the intent behind not adding to "build" the flags that are being added to "push" and "commit"?
| if err != nil { | ||
| return err | ||
| } | ||
| options.CompressionFormat = &algo |
There was a problem hiding this comment.
Was the bit that checks for c.Flag("compression-format").Changed above intended to be merged into this block, to parallel the similar logic in the next block?
There was a problem hiding this comment.
Ah, that is much cleaner. I will fix that.
| if err != nil { | ||
| return err | ||
| } | ||
| options.CompressionFormat = &algo |
There was a problem hiding this comment.
Was the bit that checks for c.Flag("compression-format").Changed above intended to be merged into this block, to parallel the similar logic in the next block?
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Fixes: containers#6660 Fixes: containers#6072 Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
I forgot to do that. Good catch. |
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
|
@nalind I addressed your comments. |
buildah pushnow falls back tocompression_formatandcompression_levelfromcontainers.confwhen--compression-formatis not setbuildah build --cache-topassesCompressionFormat/ForceCompressionFormatto cache push, so cached layers use the configured compression instead of defaulting togzipbuildah buildgains--cache-compression-format,--cache-compression-level, and--cache-force-compressionflags for controlling cache layer compression independentlybuildah commitgains--compression-format,--compression-level, and--force-compressionflags withcontainers.conffallbackcommit.goswitch to setDirForceCompressfor all compression algorithms, not justgzippush.goblobcacheto treat any non-uncompressed format as requiring compression--disable-compressionwith--compression-format/--force-compressionFixes: #6660
Fixes: #6072
Depends on: containers/container-libs#731
What type of PR is this?
/kind bug
/kind cleanup
What this PR does / why we need it:
How to verify it
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?