ocipkg
ocipkg copied to clipboard
Removal of `get_layer_bytes()`
Hello,
I see that the 0.3.x line has removed get_layer_bytes() that I added in #94. Can this helper be restored?
You can use OciArtifact::get_layers rather than ocipkg::distribution::get_layer_bytes:
let Some((_descriptor, blob)) = OciArtifact::from_remote(image_name.clone())?
.get_layers()?
.into_iter()
.find(|(descriptor, _blob)| match descriptor.media_type() {
MediaType::ImageLayerGzip => true,
// application/vnd.docker.image.rootfs.diff.tar.gzip case
MediaType::Other(x) if x.ends_with("tar.gzip") => true,
_ => false,
})
else {
bail!("Failed to find GZIP layer in {image_name}");
};