Reorder CNI config to set options before consumers
The `WithLoNetwork` and `WithConfFile` options consume the `WithPluginDir` and `WithInterfacePrefix` settings, so they must come first. This fixes the issue that the provided plugin directory was not used for the provided configuration file. This would have been more visible, but the default `InterfacePrefix` is already "eth". Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>v0.8
parent
dc2574ceae
commit
1fedff0e4b
|
@ -28,10 +28,10 @@ func New(opt Opt) (network.Provider, error) {
|
|||
|
||||
cniHandle, err := cni.New(
|
||||
cni.WithMinNetworkCount(2),
|
||||
cni.WithConfFile(opt.ConfigPath),
|
||||
cni.WithPluginDir([]string{opt.BinaryDir}),
|
||||
cni.WithInterfacePrefix(("eth")),
|
||||
cni.WithLoNetwork,
|
||||
cni.WithInterfacePrefix(("eth")))
|
||||
cni.WithConfFile(opt.ConfigPath))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue