forked from github/multus-cni
Logging improvement (UID, net-attach-def)
This change adds pod UID and net-attach-def name in verbose log and sends kubernetes event when net-attach-def is not found.
This commit is contained in:
committed by
Tomofumi Hayashi
parent
f885b38332
commit
055a7568ad
@@ -236,6 +236,9 @@ func getKubernetesDelegate(client *ClientInfo, net *types.NetworkSelectionElemen
|
||||
logging.Debugf("getKubernetesDelegate: %v, %v, %s, %v, %v", client, net, confdir, pod, resourceMap)
|
||||
customResource, err := client.NetClient.NetworkAttachmentDefinitions(net.Namespace).Get(net.Name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
if client != nil {
|
||||
client.Eventf(pod, v1.EventTypeWarning, "NoNetworkFound", "cannot find get a network-attachment-definition (%s) in namespace (%s): %v", net.Name, net.Name, err)
|
||||
}
|
||||
return nil, resourceMap, logging.Errorf("getKubernetesDelegate: cannot find get a network-attachment-definition (%s) in namespace (%s): %v", net.Name, net.Namespace, err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user