Skip to content

Commit cc0ff2a

Browse files
committed
Add support for GetLayerInfoPiped
Depends on containers/skopeo#2554 This ensures we support e.g. images with > 100 layers. Signed-off-by: Colin Walters <[email protected]>
1 parent 0bb03ce commit cc0ff2a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/imageproxy.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ fn layer_info_proto_version() -> &'static semver::VersionReq {
9696
LAYER_INFO_PROTO_VERSION.get_or_init(|| semver::VersionReq::parse("0.2.5").unwrap())
9797
}
9898

99+
fn layer_info_piped_proto_version() -> &'static semver::VersionReq {
100+
static LAYER_INFO_PROTO_VERSION: OnceLock<semver::VersionReq> = OnceLock::new();
101+
LAYER_INFO_PROTO_VERSION.get_or_init(|| semver::VersionReq::parse("0.2.7").unwrap())
102+
}
103+
99104
#[derive(Serialize)]
100105
struct Request {
101106
method: String,
@@ -597,6 +602,13 @@ impl ImageProxy {
597602
img: &OpenedImage,
598603
) -> Result<Option<Vec<ConvertedLayerInfo>>> {
599604
tracing::debug!("Getting layer info");
605+
if layer_info_piped_proto_version().matches(&self.protover) {
606+
let (_, fd) = self
607+
.impl_request::<(), _, _>("GetLayerInfoPiped", [img.0])
608+
.await?;
609+
let buf = self.read_all_fd(fd).await?;
610+
return Ok(Some(serde_json::from_slice(&buf)?));
611+
}
600612
if !layer_info_proto_version().matches(&self.protover) {
601613
return Ok(None);
602614
}

0 commit comments

Comments
 (0)