mirror of https://github.com/docker/docs.git
Fix container matching
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
fe655270b9
commit
f5925f5a1c
|
@ -49,11 +49,15 @@ func (containers Containers) Get(IDOrName string) *Container {
|
|||
|
||||
// Match name, /name or engine/name.
|
||||
for _, container := range containers {
|
||||
found := false
|
||||
for _, name := range container.Names {
|
||||
if name == IDOrName || name == "/"+IDOrName || container.Engine.ID+name == IDOrName || container.Engine.Name+name == IDOrName {
|
||||
return container
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if found {
|
||||
candidates = append(candidates, container)
|
||||
}
|
||||
}
|
||||
|
||||
if size := len(candidates); size == 1 {
|
||||
|
|
Loading…
Reference in New Issue