Skip to content

Commit

Permalink
feat: add info logging for layers merging
Browse files Browse the repository at this point in the history
Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com>
  • Loading branch information
BioTheWolff committed Apr 26, 2024
1 parent 69093ed commit a362377
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fs-gen/src/image_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use fuse_backend_rs::{
passthrough::{self, PassthroughFs},
transport::{FuseChannel, FuseSession},
};
use tracing::{debug, warn};
use tracing::{debug, info, warn};

static FILE_EXISTS_ERROR: i32 = 17;

Expand Down Expand Up @@ -72,6 +72,8 @@ fn ensure_folder_created(output_folder: &Path) -> Result<()> {
/// merge_layer(vec!["source/layer_1", "source/layer_2"], "/tmp/fused_layers", "/tmp")
/// ```
pub fn merge_layer(blob_paths: &[PathBuf], output_folder: &Path, tmp_folder: &Path) -> Result<()> {
info!("Starting to merge layers...");

// Stack all lower layers
let mut lower_layers = Vec::new();
for lower in blob_paths {
Expand Down Expand Up @@ -134,6 +136,8 @@ pub fn merge_layer(blob_paths: &[PathBuf], output_folder: &Path, tmp_folder: &Pa
.with_context(|| "Failed to unmount the fuse session".to_string())?;

let _ = handle.join();

info!("Finished merging layers!");
Ok(())
}

Expand Down

0 comments on commit a362377

Please sign in to comment.