Skip to content

Commit

Permalink
Genie modifications to use cni 0.7.0 version
Browse files Browse the repository at this point in the history
  • Loading branch information
sushanthakumar committed May 15, 2019
1 parent f5bde60 commit a430cba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion cni-genie.go
Expand Up @@ -72,6 +72,12 @@ func cmdDel(args *skel.CmdArgs) error {
return nil
}

func cmdCheck(args *skel.CmdArgs) error {
fmt.Fprintf(os.Stderr, "CNI Genie cmdCheck = %v\n", string(args.StdinData))

return nil
}

func main() {
skel.PluginMain(cmdAdd, cmdDel, version.All)
skel.PluginMain(cmdAdd, cmdCheck, cmdDel, version.All, "CNI Genie plugin")
}
7 changes: 5 additions & 2 deletions interfaces/invoke.go
@@ -1,6 +1,7 @@
package interfaces

import (
"context"
"github.com/containernetworking/cni/libcni"
"github.com/containernetworking/cni/pkg/types"
)
Expand All @@ -16,10 +17,12 @@ type Invoke struct {

func (i *Invoke) InvokeExecAdd(config *libcni.NetworkConfigList, rtConf *libcni.RuntimeConf) (types.Result, error) {
cniConfig := libcni.CNIConfig{Path: i.Path}
return cniConfig.AddNetworkList(config, rtConf)
ctx := context.TODO()
return cniConfig.AddNetworkList(ctx, config, rtConf)
}

func (i *Invoke) InvokeExecDel(config *libcni.NetworkConfigList, rtConf *libcni.RuntimeConf) error {
cniConfig := libcni.CNIConfig{Path: i.Path}
return cniConfig.DelNetworkList(config, rtConf)
ctx := context.TODO()
return cniConfig.DelNetworkList(ctx, config, rtConf)
}

0 comments on commit a430cba

Please sign in to comment.