Skip to content

Commit

Permalink
bump max layer default
Browse files Browse the repository at this point in the history
and save one layer for remaining content
  • Loading branch information
tofay committed Sep 19, 2024
1 parent 4b9d2a6 commit 492254c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/image_layerer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct ImageLayerer {
#[builder(setter(custom))]
oci_dir: OciDir,
/// The maximum number of layers to create.
/// The default is 100.
/// The default is 125.
#[builder(default = "default_max_layers()")]
max_layers: usize,
/// The time the image was created.
Expand Down Expand Up @@ -91,7 +91,7 @@ impl ImageLayererBuilder {
}

fn default_max_layers() -> usize {
100
125
}

fn default_creation_time() -> DateTime<chrono::Utc> {
Expand Down Expand Up @@ -142,7 +142,7 @@ impl ImageLayerer {
/// Returns the descriptor for the image manifest.
pub fn create_image(self) -> Result<Descriptor> {
// Determine most popular packages
let popular_packages = most_popular_packages(&self.filesystem_root, self.max_layers)?;
let popular_packages = most_popular_packages(&self.filesystem_root, self.max_layers - 1)?;
// Create a a layer for each package
let mut package_layers = self.package_layers(&popular_packages)?;
let path_to_layer_map = path_to_layer_map(popular_packages);
Expand Down

0 comments on commit 492254c

Please sign in to comment.