Skip to content

Commit

Permalink
config, deployment: point to multus socket instead of dir
Browse files Browse the repository at this point in the history
The multus socket by default is named `multus.sock` as can be seen in [0].

[0] - https://github.com/k8snetworkplumbingwg/multus-cni/blob/549808011920e6c6f0dd4b78a75250d865e7c1c9/pkg/server/api/socket.go#L23

Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed Aug 30, 2022
1 parent 3794312 commit a2d9f79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
// DefaultDynamicNetworksControllerConfigFile is the default path of the config file
DefaultDynamicNetworksControllerConfigFile = "/etc/cni/net.d/multus.d/daemon-config.json"
containerdSocketPath = "/run/containerd/containerd.sock"
defaultMultusRunDir = "/var/run/multus-cni/"
defaultMultusSocketPath = "/var/run/multus-cni/multus.sock"
)

type Multus struct {
Expand Down Expand Up @@ -41,7 +41,7 @@ func LoadConfig(configPath string) (*Multus, error) {
}

if daemonNetConf.MultusSocketPath == "" {
daemonNetConf.MultusSocketPath = defaultMultusRunDir
daemonNetConf.MultusSocketPath = defaultMultusSocketPath
}

if daemonNetConf.CriSocketPath == "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var _ = Describe("The dynamic network attachment configuration", func() {
).To(
WithTransform(func(multusConfig *Multus) string {
return multusConfig.MultusSocketPath
}, Equal(defaultMultusRunDir)))
}, Equal(defaultMultusSocketPath)))
})

It("specifies the containerd socket as default", func() {
Expand Down

0 comments on commit a2d9f79

Please sign in to comment.