Skip to content

Commit a092421

Browse files
authored
Merge pull request #1584 from cgwalters/bump-proxy
Bump containers-image-proxy, ocidir, oci-spec and composefs-rs
2 parents 276018f + 064acf2 commit a092421

File tree

7 files changed

+36
-30
lines changed

7 files changed

+36
-30
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ cap-std-ext = "4.0.3"
3939
chrono = { version = "0.4.38", default-features = false }
4040
clap = "4.5.4"
4141
clap_mangen = { version = "0.2.20" }
42-
composefs = { git = "https://github.com/containers/composefs-rs", rev = "ce28ee8a7b43290941d208c8ca820150a6504d5a", package = "composefs", features = ["rhel9"] }
43-
composefs-boot = { git = "https://github.com/containers/composefs-rs", rev = "ce28ee8a7b43290941d208c8ca820150a6504d5a", package = "composefs-boot" }
44-
composefs-oci = { git = "https://github.com/containers/composefs-rs", rev = "ce28ee8a7b43290941d208c8ca820150a6504d5a", package = "composefs-oci" }
42+
composefs = { git = "https://github.com/containers/composefs-rs", rev = "8402af606ff0866a6c4d891264cfac869da22ed7", package = "composefs", features = ["rhel9"] }
43+
composefs-boot = { git = "https://github.com/containers/composefs-rs", rev = "8402af606ff0866a6c4d891264cfac869da22ed7", package = "composefs-boot" }
44+
composefs-oci = { git = "https://github.com/containers/composefs-rs", rev = "8402af606ff0866a6c4d891264cfac869da22ed7", package = "composefs-oci" }
4545
fn-error-context = "0.2.1"
4646
hex = "0.4.3"
4747
indicatif = "0.18.0"

crates/ostree-ext/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ xshell = { workspace = true, optional = true }
4141

4242
# Crate-specific dependencies
4343
comfy-table = "7.1.1"
44-
containers-image-proxy = "0.8.0"
44+
containers-image-proxy = "0.9.0"
4545
flate2 = { features = ["zlib"], default-features = false, version = "1.0.20" }
4646
futures-util = "0.3.13"
4747
gvariant = "0.5.0"
4848
indexmap = { version = "2.2.2", features = ["serde"] }
4949
io-lifetimes = "3"
5050
libsystemd = "0.7.0"
51-
ocidir = "0.4.0"
51+
ocidir = "0.6.0"
5252
# We re-export this library too.
5353
ostree = { features = ["v2025_3"], version = "0.20.3" }
5454
pin-project = "1.0"

crates/ostree-ext/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ async fn container_history(repo: &ostree::Repo, imgref: &ImageReference) -> Resu
942942
.set_content_arrangement(comfy_table::ContentArrangement::Dynamic)
943943
.set_header(["ID", "SIZE", "CRCEATED BY"]);
944944

945-
let mut history = img.configuration.history().iter();
945+
let mut history = img.configuration.history().iter().flatten();
946946
let layers = img.manifest.layers().iter();
947947
for layer in layers {
948948
let histent = history.next();

crates/ostree-ext/src/container/store.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,13 @@ impl PreparedImport {
274274
) -> impl Iterator<Item = Result<(&ManifestLayerState, &History)>> {
275275
// FIXME use .filter(|h| h.empty_layer.unwrap_or_default()) after https://github.com/containers/oci-spec-rs/pull/100 lands.
276276
let truncated = std::iter::once_with(|| Err(anyhow::anyhow!("Truncated history")));
277-
let history = self.config.history().iter().map(Ok).chain(truncated);
277+
let history = self
278+
.config
279+
.history()
280+
.iter()
281+
.flatten()
282+
.map(Ok)
283+
.chain(truncated);
278284
self.all_layers()
279285
.zip(history)
280286
.map(|(s, h)| h.map(|h| (s, h)))
@@ -1486,7 +1492,9 @@ pub(crate) fn export_to_oci(
14861492
let mut new_manifest = srcinfo.manifest.clone();
14871493
new_manifest.layers_mut().clear();
14881494
let mut new_config = srcinfo.configuration.clone();
1489-
new_config.history_mut().clear();
1495+
if let Some(history) = new_config.history_mut() {
1496+
history.clear();
1497+
}
14901498
new_config.rootfs_mut().diff_ids_mut().clear();
14911499

14921500
let mut dest_oci = ocidir::OciDir::ensure(dest_oci.try_clone()?)?;
@@ -1538,17 +1546,14 @@ pub(crate) fn export_to_oci(
15381546
.get(i)
15391547
.and_then(|l| l.annotations().as_ref())
15401548
.cloned();
1541-
let previous_description = srcinfo
1542-
.configuration
1543-
.history()
1544-
.get(i)
1549+
let history = srcinfo.configuration.history().as_ref();
1550+
let history_entry = history.and_then(|v| v.get(i));
1551+
let previous_description = history_entry
1552+
.clone()
15451553
.and_then(|h| h.comment().as_deref())
15461554
.unwrap_or_default();
15471555

1548-
let previous_created = srcinfo
1549-
.configuration
1550-
.history()
1551-
.get(i)
1556+
let previous_created = history_entry
15521557
.and_then(|h| h.created().as_deref())
15531558
.and_then(bootc_utils::try_deserialize_timestamp)
15541559
.unwrap_or_default();

crates/ostree-ext/src/integrationtest.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ use camino::Utf8Path;
88
use cap_std::fs::Dir;
99
use cap_std_ext::cap_std;
1010
use containers_image_proxy::oci_spec;
11+
use flate2::write::GzEncoder;
1112
use fn_error_context::context;
1213
use gio::prelude::*;
1314
use oci_spec::image as oci_image;
1415
use ocidir::{
1516
oci_spec::image::{Arch, Platform},
16-
GzipLayerWriter,
17+
LayerWriter,
1718
};
1819
use ostree::gio;
1920
use xshell::cmd;
@@ -63,7 +64,7 @@ pub fn generate_derived_oci_from_tar<F>(
6364
arch: Option<Arch>,
6465
) -> Result<()>
6566
where
66-
F: FnOnce(&mut GzipLayerWriter) -> Result<()>,
67+
F: for<'a> FnOnce(&mut LayerWriter<'a, GzEncoder<ocidir::BlobWriter<'a>>>) -> Result<()>,
6768
{
6869
let src = src.as_ref();
6970
let src = Dir::open_ambient_dir(src, cap_std::ambient_authority())?;
@@ -95,7 +96,7 @@ where
9596
.build()
9697
.unwrap(),
9798
);
98-
config.history_mut().push(
99+
config.history_mut().get_or_insert_default().push(
99100
oci_spec::image::HistoryBuilder::default()
100101
.created_by("generate_derived_oci")
101102
.build()

crates/ostree-ext/tests/it/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ async fn impl_test_container_import_export(chunked: bool) -> Result<()> {
574574

575575
let n_chunks = if chunked { LAYERS_V0_LEN } else { 1 };
576576
assert_eq!(cfg.rootfs().diff_ids().len(), n_chunks);
577-
assert_eq!(cfg.history().len(), n_chunks);
577+
assert_eq!(cfg.history().as_ref().unwrap().len(), n_chunks);
578578

579579
// Verify exporting to ociarchive
580580
{

0 commit comments

Comments
 (0)