Skip to content

Commit

Permalink
allow non-gzip layers
Browse files Browse the repository at this point in the history
  • Loading branch information
tofay committed Sep 25, 2024
1 parent a41c6bc commit bb59a99
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ pub struct Layer {
pub blob: Blob,
/// The uncompressed digest, which will be used for "diffid"s
pub uncompressed_sha256: Sha256Digest,
/// The media type of the layer
pub media_type: MediaType,
}

impl Layer {
/// Return the descriptor for this layer
pub fn descriptor(&self) -> oci_image::DescriptorBuilder {
self.blob.descriptor().media_type(MediaType::ImageLayerGzip)
self.blob.descriptor().media_type(self.media_type.clone())
}

/// Return a Digest instance for the uncompressed SHA-256.
Expand Down Expand Up @@ -639,6 +641,7 @@ impl<'a> GzipLayerWriter<'a> {
Ok(Layer {
blob,
uncompressed_sha256,
media_type: MediaType::ImageLayerGzip,
})
}
}
Expand Down

0 comments on commit bb59a99

Please sign in to comment.