MCPcopy
hub / github.com/docker/compose / unlabeledLocalImages

Method unlabeledLocalImages

pkg/compose/image_pruner.go:174–184  ·  view source on GitHub ↗

unlabeledLocalImages are images that match the implicit naming convention for locally-built images but did not get labeled, presumably because they were produced by an older version of Compose. This is transitional to ensure `down` continues to work as expected on projects built/launched by previou

(ctx context.Context)

Source from the content-addressed store, hash-verified

172// projects built/launched by previous versions of Compose. It can safely
173// be removed after some time.
174func (p *ImagePruner) unlabeledLocalImages(ctx context.Context) ([]string, error) {
175 var images []string
176 for _, service := range p.project.Services {
177 if service.Image != "" {
178 continue
179 }
180 img := api.GetImageNameOrDefault(service, p.project.Name)
181 images = append(images, img)
182 }
183 return p.filterImagesByExistence(ctx, images)
184}
185
186// filterImagesByExistence returns the subset of images that exist in the
187// engine store.

Callers 1

ImagesToPruneMethod · 0.95

Calls 2

GetImageNameOrDefaultFunction · 0.92

Tested by

no test coverage detected