Skip to content

Commit aa84d9c

Browse files
author
Aaron Lehmann
committed
Support zstd compression in image commit
Without this change, specifying `Compression: imagebuildah.Zstd` in `imagebuildah`'s `BuildOptions fails, so it is not possible to push cache to a registry with zstd compression. Note this is only applicable to OCI manifests. Signed-off-by: Aaron Lehmann <[email protected]>
1 parent 22201db commit aa84d9c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

image.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,8 @@ func (mb *ociManifestBuilder) computeLayerMIMEType(what string, layerCompression
621621
// how to decompress them, we can't try to compress layers with xz.
622622
return errors.New("media type for xz-compressed layers is not defined")
623623
case archive.Zstd:
624-
// Until the image specs define a media type for zstd-compressed layers, even if we know
625-
// how to decompress them, we can't try to compress layers with zstd.
626-
return errors.New("media type for zstd-compressed layers is not defined")
624+
omediaType = v1.MediaTypeImageLayerZstd
625+
logrus.Debugf("compressing %s with zstd", what)
627626
default:
628627
logrus.Debugf("compressing %s with unknown compressor(?)", what)
629628
}

0 commit comments

Comments
 (0)