pkg/config: turn PastaOptions into attributedstring.Slice

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2023-10-25 14:34:45 +02:00
parent 5fb9ed7f84
commit f4afa37c23
3 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ func Setup(opts *SetupOptions) error {
}
// first append options set in the config
cmdArgs = append(cmdArgs, opts.Config.Network.PastaOptions...)
cmdArgs = append(cmdArgs, opts.Config.Network.PastaOptions.Get()...)
// then append the ones that were set on the cli
cmdArgs = append(cmdArgs, opts.ExtraOptions...)

View File

@ -598,7 +598,7 @@ type NetworkConfig struct {
// PastaOptions contains a default list of pasta(1) options that should
// be used when running pasta.
PastaOptions []string `toml:"pasta_options,omitempty"`
PastaOptions attributedstring.Slice `toml:"pasta_options,omitempty"`
}
type SubnetPool struct {

View File

@ -129,12 +129,12 @@ var _ = Describe("Config Local", func() {
// Given
config, err := New(nil)
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(config.Network.PastaOptions).To(gomega.BeNil())
gomega.Expect(config.Network.PastaOptions.Values).To(gomega.BeNil())
// When
config2, err := NewConfig("testdata/containers_default.conf")
// Then
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(config2.Network.PastaOptions).To(gomega.Equal([]string{"-t", "auto"}))
gomega.Expect(config2.Network.PastaOptions.Get()).To(gomega.Equal([]string{"-t", "auto"}))
})
It("parse default_rootless_network_cmd", func() {