mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-09-13 21:18:05 +00:00
Check ConfList in delete network by cache
This change adds ConfList check in get delegates from cache, to delete network gracefully.
This commit is contained in:
committed by
Tomofumi Hayashi
parent
69ac1a5935
commit
f11c851d97
@@ -479,6 +479,12 @@ func cmdDel(args *skel.CmdArgs, exec invoke.Exec, kubeClient k8s.KubeClient) err
|
||||
if err := json.Unmarshal(netconfBytes, &in.Delegates); err != nil {
|
||||
return logging.Errorf("Multus: failed to load netconf: %v", err)
|
||||
}
|
||||
// check plugins field and enable ConfListPlugin if there is
|
||||
for _, v := range in.Delegates {
|
||||
if len(v.ConfList.Plugins) != 0 {
|
||||
v.ConfListPlugin = true
|
||||
}
|
||||
}
|
||||
// First delegate is always the master plugin
|
||||
in.Delegates[0].MasterPlugin = true
|
||||
}
|
||||
|
Reference in New Issue
Block a user