Added windows hostProcess cni skip

Signed-off-by: Peri Thompson <perit@vmware.com>
This commit is contained in:
Peri Thompson
2021-08-11 22:23:49 +01:00
parent 7d4c95ff04
commit 79b369a0bb
8 changed files with 36 additions and 1 deletions

View File

@@ -414,6 +414,9 @@ func (c *criService) loadSandbox(ctx context.Context, cntr containerd.Container)
// Don't need to load netns for host network sandbox.
return sandbox, nil
}
if goruntime.GOOS == "windows" && meta.Config.GetWindows().GetSecurityContext().GetHostProcess() {
return sandbox, nil
}
sandbox.NetNS = netns.LoadNetNS(meta.NetNSPath)
// It doesn't matter whether task is running or not. If it is running, sandbox