mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Adding check to ensure containerIDs are unique in multi-container mode.
PiperOrigin-RevId: 489073573
This commit is contained in:
committed by
gVisor bot
parent
30f74b954c
commit
84548b7893
@@ -303,6 +303,11 @@ func (l *Lifecycle) StartContainer(args *StartContainerArgs, _ *uint32) error {
|
||||
if l.containerMap == nil {
|
||||
l.containerMap = make(map[string]*Container)
|
||||
}
|
||||
|
||||
if _, ok := l.containerMap[initArgs.ContainerID]; ok {
|
||||
return fmt.Errorf("container id: %v already exists", initArgs.ContainerID)
|
||||
}
|
||||
|
||||
l.containerMap[initArgs.ContainerID] = c
|
||||
l.mu.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user