Skip to content

Update to ostree-rs 0.20 #1069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build container (fedora)
run: sudo podman build --build-arg=base=quay.io/fedora/fedora-bootc:40 -t localhost/bootc -f hack/Containerfile .
run: sudo podman build --build-arg=base=quay.io/fedora/fedora-bootc:41 -t localhost/bootc -f hack/Containerfile .
- name: Container integration
run: sudo podman run --rm localhost/bootc bootc-integration-tests container
cargo-deny:
Expand Down
121 changes: 33 additions & 88 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hack/Containerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build bootc from the current git into a c9s-bootc container image.
# Use e.g. --build-arg=base=quay.io/fedora/fedora-bootc:40 to target
# Use e.g. --build-arg=base=quay.io/fedora/fedora-bootc:41 to target
# Fedora instead.
#
# You can also generate an image with cloud-init and other dependencies
Expand Down
2 changes: 1 addition & 1 deletion ostree-ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ version = "0.15.3"
# semver here you must also bump our semver.
containers-image-proxy = "0.7.0"
# We re-export this library too.
ostree = { features = ["v2022_6"], version = "0.19.0" }
ostree = { features = ["v2025_1"], version = "0.20.0" }

# Private dependencies
anyhow = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion ostree-ext/src/container/encapsulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn commit_meta_to_labels<'a>(
// Copy standard metadata keys `ostree.bootable` and `ostree.linux`.
// Bootable is an odd one out in being a boolean.
#[allow(clippy::explicit_auto_deref)]
if let Some(v) = meta.lookup::<bool>(*ostree::METADATA_KEY_BOOTABLE)? {
if let Some(v) = meta.lookup::<bool>(ostree::METADATA_KEY_BOOTABLE)? {
labels.insert(ostree::METADATA_KEY_BOOTABLE.to_string(), v.to_string());
labels.insert(BOOTC_LABEL.into(), "1".into());
}
Expand Down
4 changes: 2 additions & 2 deletions ostree-ext/src/container/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,9 @@ impl ImageImporter {
) -> Result<Box<PreparedImport>> {
let config_labels = super::labels_of(&config);
if self.require_bootable {
let bootable_key = *ostree::METADATA_KEY_BOOTABLE;
let bootable_key = ostree::METADATA_KEY_BOOTABLE;
let bootable = config_labels.map_or(false, |l| {
l.contains_key(bootable_key) || l.contains_key(BOOTC_LABEL)
l.contains_key(bootable_key.as_str()) || l.contains_key(BOOTC_LABEL)
});
if !bootable {
anyhow::bail!("Target image does not have {bootable_key} label");
Expand Down
4 changes: 2 additions & 2 deletions ostree-ext/src/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ fn build_mapping_recurse(
gio::FileType::Directory => {
build_mapping_recurse(path, &child, ret)?;
}
o => anyhow::bail!("Unhandled file type: {}", o),
o => anyhow::bail!("Unhandled file type: {o:?}"),
}
path.pop();
}
Expand Down Expand Up @@ -725,7 +725,7 @@ impl Fixture {
metadata.insert("version", &"42.0");
#[allow(clippy::explicit_auto_deref)]
if self.bootable {
metadata.insert(*ostree::METADATA_KEY_BOOTABLE, &true);
metadata.insert(ostree::METADATA_KEY_BOOTABLE, &true);
}
let metadata = metadata.to_variant();
let commit = self.srcrepo.write_commit_with_time(
Expand Down
1 change: 0 additions & 1 deletion ostree-ext/src/ima.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use camino::Utf8PathBuf;
use fn_error_context::context;
use gio::glib;
use gio::prelude::*;
use glib::Cast;
use glib::Variant;
use gvariant::aligned_bytes::TryAsAligned;
use gvariant::{gv, Marker, Structure};
Expand Down
2 changes: 1 addition & 1 deletion ostree-ext/src/ostree_prepareroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use std::str::FromStr;
use anyhow::{Context, Result};
use camino::Utf8Path;
use cap_std_ext::dirext::CapStdExtDirExt;
use glib::Cast;
use ocidir::cap_std::fs::Dir;
use ostree::glib::object::Cast;
use ostree::prelude::FileExt;
use ostree::{gio, glib};

Expand Down
2 changes: 1 addition & 1 deletion ostree-ext/src/tar/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl Importer {
match &mut self.data {
ImporterMode::ObjectSet(_) => {
anyhow::bail!(
"Found metadata object {}.{} in object set mode",
"Found metadata object {}.{:?} in object set mode",
checksum,
objtype
);
Expand Down
2 changes: 1 addition & 1 deletion tests/containerfiles/lbi/Containerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build bootc from the current git into a c9s-bootc container image.
# Use e.g. --build-arg=base=quay.io/fedora/fedora-bootc:40 to target
# Use e.g. --build-arg=base=quay.io/fedora/fedora-bootc:41 to target
# Fedora instead.
#
# You can also generate an image with cloud-init and other dependencies
Expand Down