From ae1e081eaf09c7f0e4e51f35d83d54cfaefdc6e8 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 21 Sep 2021 14:13:59 +0200 Subject: [PATCH] copier: add OciAcceptUncompressedLayers option Add an option to allow for accepting uncompressed layers when copying OCI images. Context: github.com/containers/podman/issues/11613 Signed-off-by: Valentin Rothberg --- libimage/copier.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libimage/copier.go b/libimage/copier.go index 7396ed4a1..42d3690b9 100644 --- a/libimage/copier.go +++ b/libimage/copier.go @@ -70,6 +70,8 @@ type CopyOptions struct { // types. Short forms (e.g., oci, v2s2) used by some tools are not // supported. ManifestMIMEType string + // Accept uncompressed layers when copying OCI images. + OciAcceptUncompressedLayers bool // If OciEncryptConfig is non-nil, it indicates that an image should be // encrypted. The encryption options is derived from the construction // of EncryptConfig object. Note: During initial encryption process of @@ -255,6 +257,9 @@ func (r *Runtime) newCopier(options *CopyOptions) (*copier, error) { c.systemContext.CompressionLevel = options.CompressionLevel } + // NOTE: for the sake of consistency it's called Oci* in the CopyOptions. + c.systemContext.OCIAcceptUncompressedLayers = options.OciAcceptUncompressedLayers + policy, err := signature.DefaultPolicy(c.systemContext) if err != nil { return nil, err