From f11c851d975b0657a2aaf4f1a2b1927ee04556d7 Mon Sep 17 00:00:00 2001 From: Tomofumi Hayashi Date: Fri, 29 Mar 2019 21:31:49 +0900 Subject: [PATCH] Check ConfList in delete network by cache This change adds ConfList check in get delegates from cache, to delete network gracefully. --- multus/multus.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multus/multus.go b/multus/multus.go index b3c4f3484..cb6f16ae2 100644 --- a/multus/multus.go +++ b/multus/multus.go @@ -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 }