diff --git a/docs/containers.conf.5.md b/docs/containers.conf.5.md index 69f93c138..c9b399e8d 100644 --- a/docs/containers.conf.5.md +++ b/docs/containers.conf.5.md @@ -723,6 +723,13 @@ the primary uid/gid of the container. Specifies the compression format to use when pushing an image. Supported values are: `gzip`, `zstd` and `zstd:chunked`. +**compression_level**="5" + +The compression level to use when pushing an image. Valid options +depend on the compression format used. For gzip, valid options are +1-9, with a default of 5. For zstd, valid options are 1-20, with a +default of 3. + ## SERVICE DESTINATION TABLE The `engine.service_destinations` table contains configuration options used to set up remote connections to the podman service for the podman API. diff --git a/pkg/config/config.go b/pkg/config/config.go index 3ed71f662..a408b4fd4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -510,6 +510,9 @@ type EngineConfig struct { // CompressionFormat is the compression format used to compress image layers. CompressionFormat string `toml:"compression_format,omitempty"` + + // CompressionLevel is the compression level used to compress image layers. + CompressionLevel *int `toml:"compression_level,omitempty"` } // SetOptions contains a subset of options in a Config. It's used to indicate if diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 612609283..2c0f2fb19 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -34,6 +34,7 @@ var _ = Describe("Config", func() { gomega.Expect(defaultConfig.Containers.ReadOnly).To(gomega.BeFalse()) gomega.Expect(defaultConfig.Engine.ServiceTimeout).To(gomega.BeEquivalentTo(5)) gomega.Expect(defaultConfig.Engine.CompressionFormat).To(gomega.BeEquivalentTo("gzip")) + gomega.Expect(defaultConfig.Engine.CompressionLevel).To(gomega.BeNil()) gomega.Expect(defaultConfig.NetNS()).To(gomega.BeEquivalentTo("private")) gomega.Expect(defaultConfig.IPCNS()).To(gomega.BeEquivalentTo("shareable")) gomega.Expect(defaultConfig.Engine.InfraImage).To(gomega.BeEquivalentTo("")) diff --git a/pkg/config/containers.conf b/pkg/config/containers.conf index c4efc4148..ec881f2fc 100644 --- a/pkg/config/containers.conf +++ b/pkg/config/containers.conf @@ -381,6 +381,12 @@ default_sysctls = [ # #compression_format = "gzip" +# The compression level to use when pushing an image. +# Valid options depend on the compression format used. +# For gzip, valid options are 1-9, with a default of 5. +# For zstd, valid options are 1-20, with a default of 3. +# +#compression_level = 5 # Cgroup management implementation used for the runtime. # Valid options "systemd" or "cgroupfs" diff --git a/pkg/config/containers.conf-freebsd b/pkg/config/containers.conf-freebsd index 7fe7538a1..5e187893b 100644 --- a/pkg/config/containers.conf-freebsd +++ b/pkg/config/containers.conf-freebsd @@ -311,6 +311,13 @@ default_sysctls = [ # #compression_format = "gzip" +# The compression level to use when pushing an image. +# Valid options depend on the compression format used. +# For gzip, valid options are 1-9, with a default of 5. +# For zstd, valid options are 1-20, with a default of 3. +# +#compression_level = 5 + # Environment variables to pass into conmon # #conmon_env_vars = [