Skip to content

Commit

Permalink
Merge pull request #1045 from cgwalters/ext-context
Browse files Browse the repository at this point in the history
ostree-ext/encapsulate: Add some error contexts
  • Loading branch information
cgwalters authored Jan 21, 2025
2 parents 0d88682 + ded8a6b commit 2f90eff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ostree-ext/src/container/encapsulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,11 @@ async fn build_impl(
let (path, tag) = parse_oci_path_and_tag(dest.name.as_str());
tracing::debug!("using OCI path={path} tag={tag:?}");
if !Utf8Path::new(path).exists() {
std::fs::create_dir(path)?;
std::fs::create_dir(path).with_context(|| format!("Creating {path}"))?;
}
let ocidir = Dir::open_ambient_dir(path, cap_std::ambient_authority())?;
let mut ocidir = OciDir::ensure(&ocidir)?;
let ocidir = Dir::open_ambient_dir(path, cap_std::ambient_authority())
.with_context(|| format!("Opening {path}"))?;
let mut ocidir = OciDir::ensure(&ocidir).context("Opening OCI")?;
build_oci(repo, ostree_ref, &mut ocidir, tag, config, opts)?;
None
} else {
Expand Down

0 comments on commit 2f90eff

Please sign in to comment.