Skip to content
Permalink
Browse files

Check ConfList in delete network by cache

This change adds ConfList check in get delegates from cache,
to delete network gracefully.
  • Loading branch information...
s1061123 committed Mar 29, 2019
1 parent 69ac1a5 commit f11c851d975b0657a2aaf4f1a2b1927ee04556d7
Showing with 6 additions and 0 deletions.
  1. +6 −0 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
}

0 comments on commit f11c851

Please sign in to comment.
You can’t perform that action at this time.