Skip to content

Commit

Permalink
Update to ocidir 0.2
Browse files Browse the repository at this point in the history
No major changes, just API cleanups.
  • Loading branch information
cgwalters committed Aug 21, 2024
1 parent 1043b96 commit 478f624
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ once_cell = "1.9"
libc = "0.2.92"
libsystemd = "0.7.0"
openssl = "0.10.33"
ocidir = "0.1.0"
ocidir = "0.2.0"
pin-project = "1.0"
regex = "1.5.4"
rustix = { version = "0.38", features = ["fs", "process"] }
Expand Down
2 changes: 1 addition & 1 deletion lib/src/container/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ pub(crate) fn export_to_oci(
let compression = opts.skip_compression.then_some(Compression::none());
for (i, layer) in remaining_layers.iter().enumerate() {
let layer_ref = &ref_for_layer(layer)?;
let mut target_blob = dest_oci.create_raw_layer(compression)?;
let mut target_blob = dest_oci.create_gzip_layer(compression)?;
// Sadly the libarchive stuff isn't exposed via Rust due to type unsafety,
// so we'll just fork off the CLI.
let repo_dfd = repo.dfd_borrow();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/container/update_detachedmeta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub async fn update_detached_metadata(
// Create tar streams for source and destination
let src_layer = BufReader::new(tempsrc.read_blob(commit_layer)?);
let mut src_layer = flate2::read::GzDecoder::new(src_layer);
let mut out_layer = BufWriter::new(tempsrc.create_raw_layer(None)?);
let mut out_layer = BufWriter::new(tempsrc.create_gzip_layer(None)?);

// Process the tar stream and inject our new detached metadata
crate::tar::update_detached_metadata(
Expand Down
6 changes: 3 additions & 3 deletions lib/src/integrationtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use containers_image_proxy::oci_spec;
use fn_error_context::context;
use gio::prelude::*;
use oci_spec::image as oci_image;
use ocidir::RawLayerWriter;
use ocidir::GzipLayerWriter;
use ostree::gio;
use xshell::cmd;

Expand Down Expand Up @@ -58,7 +58,7 @@ pub fn generate_derived_oci_from_tar<F>(
tag: Option<&str>,
) -> Result<()>
where
F: FnOnce(&mut RawLayerWriter) -> Result<()>,
F: FnOnce(&mut GzipLayerWriter) -> Result<()>,
{
let src = src.as_ref();
let src = Dir::open_ambient_dir(src, cap_std::ambient_authority())?;
Expand All @@ -67,7 +67,7 @@ where
let mut manifest = src.read_manifest()?;
let mut config: oci_spec::image::ImageConfiguration = src.read_json_blob(manifest.config())?;

let mut bw = src.create_raw_layer(None)?;
let mut bw = src.create_gzip_layer(None)?;
f(&mut bw)?;
let new_layer = bw.complete()?;

Expand Down

0 comments on commit 478f624

Please sign in to comment.