mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Fix handling of unsupported namespaces
currentState() always adds all possible namespaces to the state, regardless of whether they are supported. If orderNamespacePaths detects an unsupported namespace, an error is returned that results in initialization failure. Fix this by only adding paths of supported namespaces to the state. Signed-off-by: Ido Yariv <ido@wizery.com>
This commit is contained in:
@@ -1064,6 +1064,9 @@ func (c *linuxContainer) currentState() (*State, error) {
|
||||
state.NamespacePaths[ns.Type] = ns.GetPath(pid)
|
||||
}
|
||||
for _, nsType := range configs.NamespaceTypes() {
|
||||
if !configs.IsNamespaceSupported(nsType) {
|
||||
continue
|
||||
}
|
||||
if _, ok := state.NamespacePaths[nsType]; !ok {
|
||||
ns := configs.Namespace{Type: nsType}
|
||||
state.NamespacePaths[ns.Type] = ns.GetPath(pid)
|
||||
|
||||
Reference in New Issue
Block a user