From c94c9599e9a73dc9388b65b716cc8c8f9bb2c558 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 a44f098ad..1ba23448c 100644 --- a/libimage/copier.go +++ b/libimage/copier.go @@ -65,6 +65,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 @@ -242,6 +244,9 @@ func (r *Runtime) newCopier(options *CopyOptions) (*copier, error) { c.systemContext.DockerCertPath = options.CertDirPath } + // 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