[carry 33883] daemon: Ignore nonexistent containers when listing containers
| ... | ... |
@@ -162,11 +162,13 @@ func (daemon *Daemon) filterByNameIDMatches(view container.View, ctx *listContex |
| 162 | 162 |
cntrs := make([]container.Snapshot, 0, len(matches)) |
| 163 | 163 |
for id := range matches {
|
| 164 | 164 |
c, err := view.Get(id) |
| 165 |
- if err != nil {
|
|
| 166 |
- return nil, err |
|
| 167 |
- } |
|
| 168 |
- if c != nil {
|
|
| 165 |
+ switch err.(type) {
|
|
| 166 |
+ case nil: |
|
| 169 | 167 |
cntrs = append(cntrs, *c) |
| 168 |
+ case container.NoSuchContainerError: |
|
| 169 |
+ // ignore error |
|
| 170 |
+ default: |
|
| 171 |
+ return nil, err |
|
| 170 | 172 |
} |
| 171 | 173 |
} |
| 172 | 174 |
|