Persist container and sandbox if resource cleanup fails, like teardownPodNetwork

Signed-off-by: Qiutong Song <songqt01@gmail.com>
This commit is contained in:
Qiutong Song
2022-09-15 23:14:41 -07:00
parent 7a66f70b5b
commit 4f4aad057d
6 changed files with 161 additions and 85 deletions

View File

@@ -348,3 +348,12 @@ func (c *criService) taskOpts(runtimeType string) []containerd.NewTaskOpts {
return taskOpts
}
func (c *criService) updateNetNamespacePath(spec *runtimespec.Spec, nsPath string) {
for i := range spec.Linux.Namespaces {
if spec.Linux.Namespaces[i].Type == runtimespec.NetworkNamespace {
spec.Linux.Namespaces[i].Path = nsPath
break
}
}
}