File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff 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 ) ]
100105struct 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 }
You can’t perform that action at this time.
0 commit comments