Update CNI plugin directories to search default location as well
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
parent
5bc4d1d315
commit
240e5789d4
|
|
@ -38,7 +38,7 @@ func (r *Runtime) createNetNS(ctr *Container) (err error) {
|
||||||
|
|
||||||
podNetwork := getPodNetwork(ctr.ID(), ctr.Name(), ctrNS.Path(), ctr.config.PortMappings)
|
podNetwork := getPodNetwork(ctr.ID(), ctr.Name(), ctrNS.Path(), ctr.config.PortMappings)
|
||||||
|
|
||||||
_, err := r.netPlugin.SetUpPod(podNetwork)
|
_, err = r.netPlugin.SetUpPod(podNetwork)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "error configuring network namespace for container %s", ctr.ID())
|
return errors.Wrapf(err, "error configuring network namespace for container %s", ctr.ID())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ func WithCNIPluginDir(dir string) RuntimeOption {
|
||||||
return ErrRuntimeFinalized
|
return ErrRuntimeFinalized
|
||||||
}
|
}
|
||||||
|
|
||||||
rt.config.CNIPluginDir = dir
|
rt.config.CNIPluginDir = []string{dir}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ type RuntimeConfig struct {
|
||||||
MaxLogSize int64
|
MaxLogSize int64
|
||||||
NoPivotRoot bool
|
NoPivotRoot bool
|
||||||
CNIConfigDir string
|
CNIConfigDir string
|
||||||
CNIPluginDir string
|
CNIPluginDir []string
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -73,7 +73,7 @@ var (
|
||||||
MaxLogSize: -1,
|
MaxLogSize: -1,
|
||||||
NoPivotRoot: false,
|
NoPivotRoot: false,
|
||||||
CNIConfigDir: "/etc/cni/net.d/",
|
CNIConfigDir: "/etc/cni/net.d/",
|
||||||
CNIPluginDir: "/usr/libexec/cni",
|
CNIPluginDir: []string{"/usr/libexec/cni", "/opt/cni/bin"},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -173,7 +173,7 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up the CNI net plugin
|
// Set up the CNI net plugin
|
||||||
netPlugin, err := ocicni.InitCNI(runtime.config.CNIConfigDir, runtime.config.CNIPluginDir)
|
netPlugin, err := ocicni.InitCNI(runtime.config.CNIConfigDir, runtime.config.CNIPluginDir...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "error configuring CNI network plugin")
|
return nil, errors.Wrapf(err, "error configuring CNI network plugin")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue