Skip to content

Commit

Permalink
Merge pull request containers#565 from cgwalters/handle-docker-layer
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrero authored Nov 10, 2023
2 parents 0a1d55f + 728586e commit b081635
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/src/container/unencapsulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ use tokio::{
};
use tracing::instrument;

/// The legacy MIME type returned by the skopeo/(containers/storage) code
/// when we have local uncompressed docker-formatted image.
/// TODO: change the skopeo code to shield us from this correctly
const DOCKER_TYPE_LAYER_TAR: &str = "application/vnd.docker.image.rootfs.diff.tar";

type Progress = tokio::sync::watch::Sender<u64>;

/// A read wrapper that updates the download progress.
Expand Down Expand Up @@ -194,6 +199,7 @@ fn new_async_decompressor<'a>(
async_compression::tokio::bufread::GzipDecoder::new(src),
))),
oci_image::MediaType::ImageLayer => Ok(Box::new(src)),
oci_image::MediaType::Other(t) if t.as_str() == DOCKER_TYPE_LAYER_TAR => Ok(Box::new(src)),
o => Err(anyhow::anyhow!("Unhandled layer type: {}", o)),
}
}
Expand Down

0 comments on commit b081635

Please sign in to comment.