pkg/config: turn AddCompression into attributedstring.Slice

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2023-10-25 14:26:59 +02:00
parent cad0135389
commit 89b8572671
3 changed files with 4 additions and 4 deletions

View File

@ -428,7 +428,7 @@ type EngineConfig struct {
ActiveService string `toml:"active_service,omitempty"`
// Add existing instances with requested compression algorithms to manifest list
AddCompression []string `toml:"add_compression,omitempty"`
AddCompression attributedstring.Slice `toml:"add_compression,omitempty"`
// ServiceDestinations mapped by service Names
ServiceDestinations map[string]Destination `toml:"service_destinations,omitempty"`

View File

@ -501,12 +501,12 @@ var _ = Describe("Config Local", func() {
// Given
config, err := New(nil)
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(config.Engine.AddCompression).To(gomega.BeNil()) // no hard-coding to work on all platforms
gomega.Expect(config.Engine.AddCompression.Values).To(gomega.BeNil()) // no hard-coding to work on all platforms
// When
config2, err := NewConfig("testdata/containers_default.conf")
// Then
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(config2.Engine.AddCompression).To(gomega.Equal([]string{"zstd", "zstd:chunked"}))
gomega.Expect(config2.Engine.AddCompression.Get()).To(gomega.Equal([]string{"zstd", "zstd:chunked"}))
})
It("ComposeWarningLogs", func() {

View File

@ -47,7 +47,7 @@ var _ = Describe("Config", func() {
gomega.Expect(defaultConfig.Engine.EventsContainerCreateInspectData).To(gomega.BeFalse())
gomega.Expect(defaultConfig.Engine.DBBackend).To(gomega.Equal(""))
gomega.Expect(defaultConfig.Engine.PodmanshTimeout).To(gomega.BeEquivalentTo(30))
gomega.Expect(defaultConfig.Engine.AddCompression).To(gomega.BeNil())
gomega.Expect(defaultConfig.Engine.AddCompression.Values).To(gomega.BeNil())
path, err := defaultConfig.ImageCopyTmpDir()
gomega.Expect(err).To(gomega.BeNil())