mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Register container name with kernel before Loader.createContainerProcess().
Loader.createContainerProcess() => createDeviceFiles() calls devutil.GoferClientFromContext() when using nvidia-container-runtime-hook. devutil.GoferClientFromContext() expects `Kernel.containerNames` map to be initialized with the current container's ID -> name mapping. However, for sub-containers we were not initializing this map before Loader.createContainerProcess(). This change fixes that. We hadn't hit this yet because we never had multi-container usages of nvidia-container-runtime-hook. Updates #10997 PiperOrigin-RevId: 683256638
This commit is contained in:
@@ -1023,6 +1023,7 @@ func (l *Loader) startSubcontainer(spec *specs.Spec, conf *config.Config, cid st
|
||||
}
|
||||
|
||||
containerName := l.registerContainerLocked(spec, cid)
|
||||
l.k.RegisterContainerName(cid, containerName)
|
||||
info := &containerInfo{
|
||||
cid: cid,
|
||||
containerName: containerName,
|
||||
@@ -1091,7 +1092,6 @@ func (l *Loader) startSubcontainer(spec *specs.Spec, conf *config.Config, cid st
|
||||
})
|
||||
}
|
||||
|
||||
l.k.RegisterContainerName(cid, info.containerName)
|
||||
l.k.StartProcess(ep.tg)
|
||||
// No more failures from this point on.
|
||||
cu.Release()
|
||||
|
||||
Reference in New Issue
Block a user