File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -686,20 +686,22 @@ impl ImageProxy {
686686
687687 /// Fetch a blob identified by e.g. `sha256:<digest>`; does not perform
688688 /// any verification that the blob matches the digest. The size of the
689- /// blob and a pipe file descriptor are returned.
689+ /// blob (if available) and a pipe file descriptor are returned.
690690 #[ instrument]
691691 pub async fn get_raw_blob (
692692 & self ,
693693 img : & OpenedImage ,
694694 digest : & Digest ,
695695 ) -> Result < (
696- u64 ,
696+ Option < u64 > ,
697697 tokio:: fs:: File ,
698698 impl Future < Output = std:: result:: Result < ( ) , GetBlobError > > + Unpin + ' _ ,
699699 ) > {
700700 tracing:: debug!( "fetching blob" ) ;
701701 let args: Vec < serde_json:: Value > = vec ! [ img. 0 . into( ) , digest. to_string( ) . into( ) ] ;
702- let ( bloblen, fds) : ( u64 , DualFds ) = self . impl_request_with_fds ( "GetRawBlob" , args) . await ?;
702+ let ( bloblen, fds) : ( i64 , DualFds ) = self . impl_request_with_fds ( "GetRawBlob" , args) . await ?;
703+ // See the GetBlob case, we have a best-effort attempt to return the size, but it might not be known
704+ let bloblen = u64:: try_from ( bloblen) . ok ( ) ;
703705 let fd = tokio:: fs:: File :: from_std ( std:: fs:: File :: from ( fds. datafd ) ) ;
704706 let err = Self :: read_blob_error ( fds. errfd ) . boxed ( ) ;
705707 Ok ( ( bloblen, fd, err) )
You can’t perform that action at this time.
0 commit comments