labeledLocalImages are images that were locally-built by a current version of Compose (it did not always label built images). The image name could either have been defined by the user or implicitly created from the project + service name.
(ctx context.Context)
| 149 | // The image name could either have been defined by the user or implicitly |
| 150 | // created from the project + service name. |
| 151 | func (p *ImagePruner) labeledLocalImages(ctx context.Context) ([]image.Summary, error) { |
| 152 | res, err := p.client.ImageList(ctx, client.ImageListOptions{ |
| 153 | // TODO(milas): we should really clean up the dangling images as |
| 154 | // well (historically we have NOT); need to refactor this to handle |
| 155 | // it gracefully without producing confusing CLI output, i.e. we |
| 156 | // do not want to print out a bunch of untagged/dangling image IDs, |
| 157 | // they should be grouped into a logical operation for the relevant |
| 158 | // service |
| 159 | Filters: projectFilter(p.project.Name).Add("dangling", "false"), |
| 160 | }) |
| 161 | if err != nil { |
| 162 | return nil, err |
| 163 | } |
| 164 | return res.Items, nil |
| 165 | } |
| 166 | |
| 167 | // unlabeledLocalImages are images that match the implicit naming convention |
| 168 | // for locally-built images but did not get labeled, presumably because they |
no test coverage detected