pub(crate) async fn already_in_containerd(
    mut content_client: ContentClient<tonic::transport::Channel>,
    digest: &Digest,
) -> Result<bool> {
    let req = tonic::Request::new_namespaced(InfoRequest {
        digest: digest.to_string(),
    });

    let res = content_client.info(req).await;

    match res {
        Ok(_) => {
            // we don't actually care about the info, just if it exists or not
            Ok(true)
        }
        Err(e) => match e.code() {
            tonic::Code::NotFound => Ok(false),
            _ => Err(e.context(ErrorKind::GrpcUnexpectedErr).into()),
        },
    }
}
/// Check if a blob already exists in containerd's content store
Check if a blob already exists in containerd's content store
Check if a blob already exists in containerd ' s content store
pub(crate) async fn already_in_containerd(
    mut content_client: ContentClient<tonic::transport::Channel>,
    digest: &Digest,
) -> Result<bool> {
    let req = tonic::Request::new_namespaced(InfoRequest {
        digest: digest.to_string(),
    });
    let res = content_client.info(req).await;
    match res {
        Ok(_) => {
            // we don't actually care about the info, just if it exists or not
            Ok(true)
        }
        Err(e) => match e.code() {
            tonic::Code::NotFound => Ok(false),
            _ => Err(e.context(ErrorKind::GrpcUnexpectedErr).into()),
        },
    }
}
pub ( crate ) async fn already_in_containerd ( mut content_client : ContentClient < tonic :: transport :: Channel > , digest : & Digest , ) -> Result < bool > { let req = tonic :: Request :: new_namespaced ( InfoRequest { digest : digest . to_string ( ) , } ) ; let res = content_client . info ( req ) . await ; match res { Ok ( _ ) => { // we don't actually care about the info, just if it exists or not Ok ( true ) } Err ( e ) => match e . code ( ) { tonic :: Code :: NotFound => Ok ( false ) , _ => Err ( e . context ( ErrorKind :: GrpcUnexpectedErr ) . into ( ) ) , } , } }
Check if a blob already exists in containerd's content store
Check if a blob already exists in containerd ' s content store
content_client
ContentClient<tonic::transport::Channel>
digest
&Digest
content_client
ContentClient<tonic::transport::Channel>
digest
&Digest