Skip to content

Commit

Permalink
config: add CompressionLevel to containers.conf
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jun 20, 2023
1 parent ac2475a commit bab72bb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(""))
Expand Down
6 changes: 6 additions & 0 deletions pkg/config/containers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions pkg/config/containers.conf-freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit bab72bb

Please sign in to comment.