macvlan cmdDel: replace the loadConf function with json.unmarshal
When the master interface on the node has been deleted, and loadConf tries to get the MTU, This causes cmdDel to return a linkNotFound error to the runtime. The cmdDel only needs to unmarshal the netConf. No need to get the MTU. So we just replaced the loadConf function with json.unmarshal in cmdDel. Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
This commit is contained in:
parent
adaeedd6af
commit
845ef62b74
@ -382,13 +382,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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user