Skip to content

Commit

Permalink
Merge pull request #954 from cyclinder/improve_cmd_del
Browse files Browse the repository at this point in the history
macvlan cmdDel: replace the loadConf function with json.unmarshal
  • Loading branch information
squeed authored Nov 16, 2023
2 parents e147446 + 845ef62 commit abee8cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/main/macvlan/macvlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ func cmdAdd(args *skel.CmdArgs) error {
}

func cmdDel(args *skel.CmdArgs) error {
n, _, err := loadConf(args, args.Args)
var n NetConf
err := json.Unmarshal(args.StdinData, &n)
if err != nil {
return err
return fmt.Errorf("failed to load netConf: %v", err)
}

isLayer3 := n.IPAM.Type != ""

if isLayer3 {
err = ipam.ExecDel(n.IPAM.Type, args.StdinData)
if err != nil {
Expand Down

0 comments on commit abee8cc

Please sign in to comment.