Merge pull request #954 from cyclinder/improve_cmd_del

macvlan cmdDel: replace the loadConf function with json.unmarshal
This commit is contained in:
Casey Callendrello 2023-11-16 19:06:11 +01:00 committed by GitHub
commit abee8ccc0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {