Merge pull request #33908 from thaJeztah/carry-33883-ignore-nonexistent-containers
[carry 33883] daemon: Ignore nonexistent containers when listing containers
This commit is contained in:
commit
cab50de4d6
1 changed files with 6 additions and 4 deletions
|
@ -162,11 +162,13 @@ func (daemon *Daemon) filterByNameIDMatches(view container.View, ctx *listContex
|
|||
cntrs := make([]container.Snapshot, 0, len(matches))
|
||||
for id := range matches {
|
||||
c, err := view.Get(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if c != nil {
|
||||
switch err.(type) {
|
||||
case nil:
|
||||
cntrs = append(cntrs, *c)
|
||||
case container.NoSuchContainerError:
|
||||
// ignore error
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue