add cni networking with noop plugin as default

Signed-off-by: Rajat Chopra <rchopra@redhat.com>
This commit is contained in:
Rajat Chopra 2016-09-02 12:38:42 -07:00 committed by Mrunal Patel
parent ecb513e665
commit 4cf737bb7d
2 changed files with 43 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import (
"github.com/mrunalp/ocid/oci"
"github.com/mrunalp/ocid/utils"
"github.com/rajatchopra/ocicni"
)
const (
@ -18,6 +19,7 @@ type Server struct {
runtime *oci.Runtime
sandboxDir string
state *serverState
netPlugin ocicni.CNIPlugin
}
// New creates a new Server with options provided
@ -40,8 +42,13 @@ func New(runtimePath, sandboxDir, containerDir string) (*Server, error) {
}
sandboxes := make(map[string]*sandbox)
containers := make(map[string]*oci.Container)
netPlugin, err := ocicni.InitCNI("")
if err != nil {
return nil, err
}
return &Server{
runtime: r,
netPlugin: netPlugin,
sandboxDir: sandboxDir,
state: &serverState{
sandboxes: sandboxes,