Skip to content

Commit

Permalink
Return empty result for DPDK device
Browse files Browse the repository at this point in the history
Signed-off-by: Periyasamy Palanisamy <[email protected]>
  • Loading branch information
pperiyasamy committed Nov 19, 2020
1 parent a4dbb7a commit 6fc0648
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions plugins/main/host-device/host-device.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,13 @@ func cmdAdd(args *skel.CmdArgs) error {
}
defer containerNs.Close()

var result *current.Result

if len(cfg.PCIAddr) > 0 {
isDpdkMode, err := hasDpdkDriver(cfg.PCIAddr)
if err != nil {
return fmt.Errorf("error with host device: %v", err)
}
if isDpdkMode {
result = &current.Result{
CNIVersion: current.ImplementedSpecVersion,
Interfaces: []*current.Interface{
{
Name: args.IfName,
Sandbox: containerNs.Path(),
},
},
}
return types.PrintResult(result, cfg.CNIVersion)
return types.PrintResult(&current.Result{}, cfg.CNIVersion)
}
}

Expand All @@ -125,6 +114,7 @@ func cmdAdd(args *skel.CmdArgs) error {
return fmt.Errorf("failed to move link %v", err)
}

var result *current.Result
// run the IPAM plugin and get back the config to apply
if cfg.IPAM.Type != "" {
r, err := ipam.ExecAdd(cfg.IPAM.Type, args.StdinData)
Expand Down

0 comments on commit 6fc0648

Please sign in to comment.