mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-10 20:44:43 +00:00
adding error checking in network status creation as well
This commit is contained in:
parent
88759d29de
commit
1ad25a890d
@ -246,7 +246,8 @@ func cmdAdd(args *skel.CmdArgs, exec invoke.Exec, kubeClient k8s.KubeClient) (cn
|
||||
}
|
||||
|
||||
//create the network status, only in case Multus as kubeconfig
|
||||
if n.Kubeconfig != "" && kc.Podnamespace != "kube-system" {
|
||||
if n.Kubeconfig != "" && kc != nil {
|
||||
if kc.Podnamespace != "kube-system" {
|
||||
delegateNetStatus, err := types.LoadNetworkStatus(tmpResult, delegate.Conf.Name, delegate.MasterPlugin)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Multus: Err in setting networks status: %v", err)
|
||||
@ -255,6 +256,7 @@ func cmdAdd(args *skel.CmdArgs, exec invoke.Exec, kubeClient k8s.KubeClient) (cn
|
||||
netStatus = append(netStatus, delegateNetStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
// Ignore errors; DEL must be idempotent anyway
|
||||
|
Loading…
Reference in New Issue
Block a user