Skip to content

Commit

Permalink
builder: set the default compression algorithm for meta ci to lz4
Browse files Browse the repository at this point in the history
We set the compression algorithm of meta ci to zstd by default, but there
is no option for nydus-image to configure it.

This could cause compatibility problems on the nydus version that does
not support zstd. Let's reset it to lz4 by default.

Signed-off-by: Huang Jianan <[email protected]>
  • Loading branch information
mofishzz committed May 31, 2023
1 parent 08c3d0f commit 1451e9b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rafs/src/builder/core/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ impl Blob {
header.set_separate_blob(true);
};

let mut compressor = compress::Algorithm::Zstd;
let mut compressor = if ctx.conversion_type.is_to_ref() {
compress::Algorithm::Zstd
} else {
ctx.compressor
};
let (compressed_data, compressed) = compress::compress(ci_data, compressor)
.with_context(|| "failed to compress blob chunk info array".to_string())?;
if !compressed {
Expand Down

0 comments on commit 1451e9b

Please sign in to comment.