@@ -22,11 +22,6 @@ use crate::oci_spec::image as oci_image;
2222/// TODO: change the skopeo code to shield us from this correctly
2323const DOCKER_TYPE_LAYER_TAR : & str = "application/vnd.docker.image.rootfs.diff.tar" ;
2424
25- /// The Docker MIME type for gzipped layers when stored in docker-daemon.
26- /// Even though this indicates gzip compression, docker-daemon actually stores
27- /// the layers uncompressed, so we need to treat this as uncompressed.
28- const DOCKER_TYPE_LAYER_TAR_GZIP : & str = "application/vnd.docker.image.rootfs.diff.tar.gzip" ;
29-
3025/// Extends the `Read` trait with another method to get mutable access to the inner reader
3126trait ReadWithGetInnerMut : Read + Send + ' static {
3227 fn get_inner_mut ( & mut self ) -> & mut dyn Read ;
@@ -130,9 +125,6 @@ impl Decompressor {
130125 oci_image:: MediaType :: Other ( t) if t. as_str ( ) == DOCKER_TYPE_LAYER_TAR => {
131126 Box :: new ( TransparentDecompressor ( src) )
132127 }
133- oci_image:: MediaType :: Other ( t) if t. as_str ( ) == DOCKER_TYPE_LAYER_TAR_GZIP => {
134- Box :: new ( TransparentDecompressor ( src) )
135- }
136128 o => anyhow:: bail!( "Unhandled layer type: {}" , o) ,
137129 } ;
138130 Ok ( Self {
@@ -236,17 +228,4 @@ mod tests {
236228 assert_eq ! ( e. to_string( ) , "Unknown frame descriptor" . to_string( ) ) ;
237229 drop ( d)
238230 }
239-
240- #[ test]
241- fn test_docker_tar_gzip_media_type_uses_transparent_decompressor ( ) {
242- // Test that the docker-daemon gzip media type is treated as uncompressed
243- let data = b"test data" ;
244- let media_type = oci_image:: MediaType :: Other ( DOCKER_TYPE_LAYER_TAR_GZIP . to_string ( ) ) ;
245- let mut d = Decompressor :: new ( & media_type, & data[ ..] ) . unwrap ( ) ;
246- let mut buf = [ 0u8 ; 32 ] ;
247- let n = d. read ( & mut buf) . unwrap ( ) ;
248- assert_eq ! ( n, data. len( ) ) ;
249- assert_eq ! ( & buf[ ..n] , data) ;
250- drop ( d)
251- }
252231}
0 commit comments