From 3ce17181b6e6acfa927222b81ee07536dedac63c Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Fri, 21 Jun 2019 09:44:16 -0600 Subject: [PATCH 1/3] copy: add a CLI flag for OCIAcceptUncompressedLayers There are cases where we want to pass this flag to the actual copy engine, so let's add a CLI flag for it. Signed-off-by: Tycho Andersen --- cmd/skopeo/utils.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/skopeo/utils.go b/cmd/skopeo/utils.go index 320aec83..0b4948da 100644 --- a/cmd/skopeo/utils.go +++ b/cmd/skopeo/utils.go @@ -153,8 +153,9 @@ func (opts *imageOptions) newSystemContext() (*types.SystemContext, error) { // imageDestOptions is a superset of imageOptions specialized for iamge destinations. type imageDestOptions struct { *imageOptions - osTreeTmpDir string // A directory to use for OSTree temporary files - dirForceCompression bool // Compress layers when saving to the dir: transport + osTreeTmpDir string // A directory to use for OSTree temporary files + dirForceCompression bool // Compress layers when saving to the dir: transport + ociAcceptUncompressedLayers bool // Whether to accept uncompressed layers in the oci: transport } // imageDestFlags prepares a collection of CLI flags writing into imageDestOptions, and the managed imageDestOptions structure. @@ -173,6 +174,11 @@ func imageDestFlags(global *globalOptions, shared *sharedImageOptions, flagPrefi Usage: "Compress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source)", Destination: &opts.dirForceCompression, }, + cli.BoolFlag{ + Name: flagPrefix + "oci-accept-uncompressed-layers", + Usage: "Allow uncompressed image layers when saving to an OCI image using the 'oci' transport. (default is to compress things that aren't compressed)", + Destination: &opts.ociAcceptUncompressedLayers, + }, }...), &opts } @@ -186,6 +192,7 @@ func (opts *imageDestOptions) newSystemContext() (*types.SystemContext, error) { ctx.OSTreeTmpDirPath = opts.osTreeTmpDir ctx.DirForceCompress = opts.dirForceCompression + ctx.OCIAcceptUncompressedLayers = opts.ociAcceptUncompressedLayers return ctx, err } From 8a1a26018bdd62e77f13fbc2ff5aaba451466ecd Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Tue, 25 Jun 2019 15:54:24 -0600 Subject: [PATCH 2/3] bash completion: add --dest-oci-accept-uncompressed-layers Signed-off-by: Tycho Andersen --- completions/bash/skopeo | 1 + 1 file changed, 1 insertion(+) diff --git a/completions/bash/skopeo b/completions/bash/skopeo index 1b9c5c67..980797d4 100644 --- a/completions/bash/skopeo +++ b/completions/bash/skopeo @@ -57,6 +57,7 @@ _skopeo_copy() { --remove-signatures --src-no-creds --dest-no-creds + --dest-oci-accept-uncompressed-layers " local transports=" From 2469ba0a12abe04a39dbd833d3d44ae016ef10ad Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Tue, 25 Jun 2019 15:56:06 -0600 Subject: [PATCH 3/3] man pages: add --dest-oci-accept-uncompressed-layers Signed-off-by: Tycho Andersen --- docs/skopeo-copy.1.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/skopeo-copy.1.md b/docs/skopeo-copy.1.md index 33eade9a..a7728c1f 100644 --- a/docs/skopeo-copy.1.md +++ b/docs/skopeo-copy.1.md @@ -34,6 +34,8 @@ If the authorization state is not found there, $HOME/.docker/config.json is chec **--dest-compress** _bool-value_ Compress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source) +**--dest-oci-accept-uncompressed-layers** _bool-value_ Allow uncompressed image layers when saving to an OCI image using the 'oci' transport. (default is to compress things that aren't compressed) + **--dest-creds** _username[:password]_ for accessing the destination registry **--src-cert-dir** _path_ Use certificates at _path_ (*.crt, *.cert, *.key) to connect to the source registry or daemon