-
Notifications
You must be signed in to change notification settings - Fork 155
Bump to newer ocidir and containers-image-proxy #1377
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,12 +41,10 @@ pub async fn update_detached_metadata( | |
| // Open the temporary OCI directory. | ||
| let tempsrc = Dir::open_ambient_dir(tempsrc_ref_path, cap_std::ambient_authority()) | ||
| .context("Opening src")?; | ||
| let tempsrc = ocidir::OciDir::open(&tempsrc)?; | ||
| let tempsrc = ocidir::OciDir::open(tempsrc)?; | ||
|
|
||
| // Load the manifest, platform, and config | ||
| let idx = tempsrc | ||
| .read_index()? | ||
| .ok_or(anyhow!("Reading image index from source"))?; | ||
| let idx = tempsrc.read_index()?; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gemini is apparently just confused by us dropping a |
||
| let manifest_descriptor = idx | ||
| .manifests() | ||
| .first() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -973,7 +973,7 @@ impl NonOstreeFixture { | |
| // Create the src/ directory | ||
| dir.create_dir_all(Self::SRCOCI)?; | ||
| let src_oci = dir.open_dir(Self::SRCOCI)?; | ||
| let src_oci = ocidir::OciDir::ensure(&src_oci)?; | ||
| let src_oci = ocidir::OciDir::ensure(src_oci)?; | ||
|
|
||
| dir.create_dir("dest")?; | ||
| let destrepo = ostree::Repo::create_at_dir( | ||
|
|
@@ -1004,7 +1004,7 @@ impl NonOstreeFixture { | |
| }; | ||
|
|
||
| let mut config = ImageConfigurationBuilder::default().build().unwrap(); | ||
| let mut manifest = ocidir::new_empty_manifest().build().unwrap(); | ||
| let mut manifest = self.src_oci.new_empty_manifest()?.build().unwrap(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| let bw = self.src_oci.create_gzip_layer(None)?; | ||
| let mut bw = tar::Builder::new(bw); | ||
|
|
@@ -1034,7 +1034,7 @@ impl NonOstreeFixture { | |
| manifest.set_config(config); | ||
| self.src_oci | ||
| .replace_with_single_manifest(manifest, oci_image::Platform::default())?; | ||
| let idx = self.src_oci.read_index()?.unwrap(); | ||
| let idx = self.src_oci.read_index()?; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| let descriptor = idx.manifests().first().unwrap(); | ||
|
|
||
| Ok((imgref, descriptor.digest().to_owned())) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider handling the error case where
new_empty_manifestfails. Currently, it's unwrapped, which could lead to unexpected program termination.