summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-12-02 18:32:26 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-12-02 20:29:12 +0100
commitbd9f8815e1fc56c188668509025741a93649ca05 (patch)
treef655f7f7b9e5f000cbbc18c762fd8f465f252cdf
parentfe1cdab59fbde1af59bf9a940039586c313494ef (diff)
downloadpodman-bd9f8815e1fc56c188668509025741a93649ca05.tar.gz
podman-bd9f8815e1fc56c188668509025741a93649ca05.tar.bz2
podman-bd9f8815e1fc56c188668509025741a93649ca05.zip
cmd, push: use the configured compression format
[NO NEW TESTS NEEDED] I am just changing the default value Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--pkg/domain/infra/abi/images.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 7a3451a7d..4346182d6 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -306,8 +306,16 @@ 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)
+ compressionFormat := options.CompressionFormat
+ if compressionFormat == "" {
+ config, err := ir.Libpod.GetConfigNoCopy()
+ if err != nil {
+ return err
+ }
+ compressionFormat = config.Engine.CompressionFormat
+ }
+ if compressionFormat != "" {
+ algo, err := compression.AlgorithmByName(compressionFormat)
if err != nil {
return err
}