pkg/config: turn NetavarkPluginDirs into attributedstring.Slice

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

View File

@ -81,7 +81,7 @@ func NetworkBackend(store storage.Store, conf *config.Config, syslog bool) (type
NetworkRunDir: runDir,
NetavarkBinary: netavarkBin,
AardvarkBinary: aardvarkBin,
PluginDirs: conf.Network.NetavarkPluginDirs,
PluginDirs: conf.Network.NetavarkPluginDirs.Get(),
DefaultNetwork: conf.Network.DefaultNetwork,
DefaultSubnet: conf.Network.DefaultSubnet,
DefaultsubnetPools: conf.Network.DefaultSubnetPools,

View File

@ -565,7 +565,7 @@ type NetworkConfig struct {
CNIPluginDirs attributedstring.Slice `toml:"cni_plugin_dirs,omitempty"`
// NetavarkPluginDirs is a list of directories which contain netavark plugins.
NetavarkPluginDirs []string `toml:"netavark_plugin_dirs,omitempty"`
NetavarkPluginDirs attributedstring.Slice `toml:"netavark_plugin_dirs,omitempty"`
// DefaultNetwork is the network name of the default network
// to attach pods to.

View File

@ -290,7 +290,7 @@ image_copy_tmp_dir="storage"`
gomega.Expect(defaultConfig.Containers.Mounts.Values).To(gomega.BeEquivalentTo(mounts))
gomega.Expect(defaultConfig.Containers.PidsLimit).To(gomega.BeEquivalentTo(2048))
gomega.Expect(defaultConfig.Network.CNIPluginDirs.Get()).To(gomega.Equal(pluginDirs))
gomega.Expect(defaultConfig.Network.NetavarkPluginDirs).To(gomega.Equal([]string{"/usr/netavark"}))
gomega.Expect(defaultConfig.Network.NetavarkPluginDirs.Get()).To(gomega.Equal([]string{"/usr/netavark"}))
gomega.Expect(defaultConfig.Engine.NumLocks).To(gomega.BeEquivalentTo(2048))
gomega.Expect(defaultConfig.Engine.OCIRuntimes).To(gomega.Equal(OCIRuntimeMap))
gomega.Expect(defaultConfig.Engine.PlatformToOCIRuntime).To(gomega.Equal(PlatformToOCIRuntimeMap))
@ -431,7 +431,7 @@ image_copy_tmp_dir="storage"`
gomega.Expect(config.Containers.Env.Values).To(gomega.BeEquivalentTo(envs))
gomega.Expect(config.Containers.UserNS).To(gomega.BeEquivalentTo(""))
gomega.Expect(config.Network.CNIPluginDirs.Get()).To(gomega.Equal(DefaultCNIPluginDirs))
gomega.Expect(config.Network.NetavarkPluginDirs).To(gomega.Equal(DefaultNetavarkPluginDirs))
gomega.Expect(config.Network.NetavarkPluginDirs.Get()).To(gomega.Equal(DefaultNetavarkPluginDirs))
gomega.Expect(config.Engine.NumLocks).To(gomega.BeEquivalentTo(2048))
gomega.Expect(config.Engine.OCIRuntimes["runc"]).To(gomega.Equal(OCIRuntimeMap["runc"]))
gomega.Expect(config.Containers.CgroupConf.Values).To(gomega.BeNil())

View File

@ -234,7 +234,7 @@ func defaultConfig() (*Config, error) {
DefaultRootlessNetworkCmd: "slirp4netns",
DNSBindPort: 0,
CNIPluginDirs: attributedstring.Slice{Values: DefaultCNIPluginDirs},
NetavarkPluginDirs: DefaultNetavarkPluginDirs,
NetavarkPluginDirs: attributedstring.Slice{Values: DefaultNetavarkPluginDirs},
},
Engine: *defaultEngineConfig,
Secrets: defaultSecretConfig(),