Skip to content

Commit

Permalink
copier: add OciAcceptUncompressedLayers option
Browse files Browse the repository at this point in the history
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 <rothberg@redhat.com>
  • Loading branch information
vrothberg committed Sep 21, 2021
1 parent 61c922a commit ae1e081
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libimage/copier.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ae1e081

Please sign in to comment.