mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-27 20:38:47 +00:00
Check Pod parameter against nil before calling Eventf
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
parent
f6cf49b5e5
commit
c1c3193633
@ -355,11 +355,13 @@ func delegateAdd(exec invoke.Exec, kubeClient *k8s.ClientInfo, pod *v1.Pod, ifNa
|
|||||||
ips = append(ips, ip.Address.String())
|
ips = append(ips, ip.Address.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
// send kubernetes events
|
if pod != nil {
|
||||||
if delegate.Name != "" {
|
// send kubernetes events
|
||||||
kubeClient.Eventf(pod, v1.EventTypeNormal, "AddedInterface", "Add %s %v from %s", rt.IfName, ips, delegate.Name)
|
if delegate.Name != "" {
|
||||||
} else {
|
kubeClient.Eventf(pod, v1.EventTypeNormal, "AddedInterface", "Add %s %v from %s", rt.IfName, ips, delegate.Name)
|
||||||
kubeClient.Eventf(pod, v1.EventTypeNormal, "AddedInterface", "Add %s %v", rt.IfName, ips)
|
} else {
|
||||||
|
kubeClient.Eventf(pod, v1.EventTypeNormal, "AddedInterface", "Add %s %v", rt.IfName, ips)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user