diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-12-01 21:01:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 21:01:15 +0100 |
commit | 5d91edc78d5a3a96293cbb22dae85ab8c055fcc6 (patch) | |
tree | 003258ab953a4e52551f89cb16a306453d28439a /pkg | |
parent | ecc663097a5791fea01e730308528d67d534e44a (diff) | |
parent | 6673ff78d3c5bba1078d9862fccadf0b7fe556fa (diff) | |
download | podman-5d91edc78d5a3a96293cbb22dae85ab8c055fcc6.tar.gz podman-5d91edc78d5a3a96293cbb22dae85ab8c055fcc6.tar.bz2 podman-5d91edc78d5a3a96293cbb22dae85ab8c055fcc6.zip |
Merge pull request #12450 from giuseppe/compression-format
podman, push: expose --compression-format
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/entities/images.go | 2 | ||||
-rw-r--r-- | pkg/domain/infra/abi/images.go | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/pkg/domain/entities/images.go b/pkg/domain/entities/images.go index 54f7b5d45..8b0fd2b85 100644 --- a/pkg/domain/entities/images.go +++ b/pkg/domain/entities/images.go @@ -208,6 +208,8 @@ type ImagePushOptions struct { SkipTLSVerify types.OptionalBool // Progress to get progress notifications Progress chan types.ProgressProperties + // CompressionFormat is the format to use for the compression of the blobs + CompressionFormat string } // ImageSearchOptions are the arguments for searching images. 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 } |