pkg/config: turn PastaOptions into attributedstring.Slice
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
parent
5fb9ed7f84
commit
f4afa37c23
|
|
@ -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...)
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue