From 6673ff78d3c5bba1078d9862fccadf0b7fe556fa Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 30 Nov 2021 14:00:10 +0100 Subject: podman, push: expose --compression-format support overriding the compression format at push time. Signed-off-by: Giuseppe Scrivano --- pkg/domain/infra/abi/images.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/domain/infra') diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index 8b44b869a..7a3451a7d 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -18,6 +18,7 @@ import ( "github.com/containers/image/v5/docker" "github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/manifest" + "github.com/containers/image/v5/pkg/compression" "github.com/containers/image/v5/signature" "github.com/containers/image/v5/transports" "github.com/containers/image/v5/transports/alltransports" @@ -305,6 +306,14 @@ func (ir *ImageEngine) Push(ctx context.Context, source string, destination stri pushOptions.SignBy = options.SignBy pushOptions.InsecureSkipTLSVerify = options.SkipTLSVerify + if options.CompressionFormat != "" { + algo, err := compression.AlgorithmByName(options.CompressionFormat) + if err != nil { + return err + } + pushOptions.CompressionFormat = &algo + } + if !options.Quiet { pushOptions.Writer = os.Stderr } -- cgit v1.2.3-54-g00ecf