(ctx context.Context, project *types.Project, options api.DownOptions)
| 157 | } |
| 158 | |
| 159 | func (s *composeService) ensureImagesDown(ctx context.Context, project *types.Project, options api.DownOptions) ([]downOp, error) { |
| 160 | imagePruner := NewImagePruner(s.apiClient(), project) |
| 161 | pruneOpts := ImagePruneOptions{ |
| 162 | Mode: ImagePruneMode(options.Images), |
| 163 | RemoveOrphans: options.RemoveOrphans, |
| 164 | } |
| 165 | images, err := imagePruner.ImagesToPrune(ctx, pruneOpts) |
| 166 | if err != nil { |
| 167 | return nil, err |
| 168 | } |
| 169 | |
| 170 | var ops []downOp |
| 171 | for i := range images { |
| 172 | img := images[i] |
| 173 | ops = append(ops, func() error { |
| 174 | return s.removeImage(ctx, img) |
| 175 | }) |
| 176 | } |
| 177 | return ops, nil |
| 178 | } |
| 179 | |
| 180 | func (s *composeService) ensureNetworksDown(ctx context.Context, project *types.Project) []downOp { |
| 181 | var ops []downOp |
no test coverage detected