pkg/config: turn ComposeProviders into attributedstring.Slice

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2023-10-25 14:11:38 +02:00
parent f09869b142
commit 499d0a683e
3 changed files with 4 additions and 4 deletions

View File

@ -271,7 +271,7 @@ type EngineConfig struct {
// compose command. The first found provider is used for execution.
// Can be an absolute and relative path or a (file) name. Make sure to
// expand the return items via `os.ExpandEnv`.
ComposeProviders []string `toml:"compose_providers,omitempty"`
ComposeProviders attributedstring.Slice `toml:"compose_providers,omitempty"`
// ComposeWarningLogs emits logs on each invocation of the compose
// command indicating that an external compose provider is being

View File

@ -489,12 +489,12 @@ var _ = Describe("Config Local", func() {
// Given
config, err := New(nil)
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(config.Engine.ComposeProviders).To(gomega.Equal(getDefaultComposeProviders())) // no hard-coding to work on all platforms
gomega.Expect(config.Engine.ComposeProviders.Get()).To(gomega.Equal(getDefaultComposeProviders())) // 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.ComposeProviders).To(gomega.Equal([]string{"/some/thing/else", "/than/before"}))
gomega.Expect(config2.Engine.ComposeProviders.Get()).To(gomega.Equal([]string{"/some/thing/else", "/than/before"}))
})
It("AddCompression", func() {

View File

@ -288,7 +288,7 @@ func defaultEngineConfig() (*EngineConfig, error) {
c.EventsLogFileMaxSize = eventsLogMaxSize(DefaultEventsLogSizeMax)
c.CompatAPIEnforceDockerHub = true
c.ComposeProviders = getDefaultComposeProviders() // may vary across supported platforms
c.ComposeProviders = attributedstring.Slice{Values: getDefaultComposeProviders()} // may vary across supported platforms
c.ComposeWarningLogs = true
if path, ok := os.LookupEnv("CONTAINERS_STORAGE_CONF"); ok {