Fix spammy CNI log.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-11-02 22:41:59 +00:00
parent 0c1839047c
commit 73c2cb5632
2 changed files with 12 additions and 0 deletions

View File

@@ -85,6 +85,11 @@ func (c *criContainerdService) getIP(sandbox sandboxstore.Sandbox) (string, erro
return "", nil
}
// The network namespace has been closed.
if sandbox.NetNS == nil || sandbox.NetNS.Closed() {
return "", nil
}
podNetwork := ocicni.PodNetwork{
Name: config.GetMetadata().GetName(),
Namespace: config.GetMetadata().GetNamespace(),