Skip to content

Commit

Permalink
Make conflistDel() behave like conflistAdd()
Browse files Browse the repository at this point in the history
conflistAdd() finds binaries differently than conflistDel().
Make the two call find binaries the same way.

Fixes #179

Signed-off-by: Michael Cambria <mcambria@redhat.com>
  • Loading branch information
mccv1r0 authored and s1061123 committed Nov 1, 2018
1 parent 67e661f commit aa7e000
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions multus/multus.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ func conflistAdd(rt *libcni.RuntimeConf, rawnetconflist []byte, binDir string, e
return result, nil
}

func conflistDel(rt *libcni.RuntimeConf, rawnetconflist []byte, binDir string) error {
func conflistDel(rt *libcni.RuntimeConf, rawnetconflist []byte, binDir string, exec invoke.Exec) error {
logging.Debugf("conflistDel: %v, %s, %s", rt, string(rawnetconflist), binDir)
// In part, adapted from K8s pkg/kubelet/dockershim/network/cni/cni.go
binDirs := []string{binDir}
cniNet := libcni.CNIConfig{Path: binDirs}
binDirs := filepath.SplitList(os.Getenv("CNI_PATH"))
binDirs = append(binDirs, binDir)
cniNet := libcni.NewCNIConfig(binDirs, exec)

confList, err := libcni.ConfListFromBytes(rawnetconflist)
if err != nil {
Expand Down Expand Up @@ -193,7 +194,7 @@ func delegateDel(exec invoke.Exec, ifName string, delegateConf *types.DelegateNe
}

if delegateConf.ConfListPlugin != false {
err := conflistDel(rt, delegateConf.Bytes, binDir)
err := conflistDel(rt, delegateConf.Bytes, binDir, exec)
if err != nil {
return logging.Errorf("Multus: error in invoke Conflist Del - %q: %v", delegateConf.ConfList.Name, err)
}
Expand Down

0 comments on commit aa7e000

Please sign in to comment.