diff --git a/common/libnetwork/network/interface.go b/common/libnetwork/network/interface.go index 332c2e5b83..aeac8d9c15 100644 --- a/common/libnetwork/network/interface.go +++ b/common/libnetwork/network/interface.go @@ -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, diff --git a/common/pkg/config/config.go b/common/pkg/config/config.go index dd473783ab..284612f921 100644 --- a/common/pkg/config/config.go +++ b/common/pkg/config/config.go @@ -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. diff --git a/common/pkg/config/config_test.go b/common/pkg/config/config_test.go index b0dd81071b..fe5d1b4d04 100644 --- a/common/pkg/config/config_test.go +++ b/common/pkg/config/config_test.go @@ -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()) diff --git a/common/pkg/config/default.go b/common/pkg/config/default.go index e95f806cfe..f98706c480 100644 --- a/common/pkg/config/default.go +++ b/common/pkg/config/default.go @@ -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(),