(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts removeOptions, services []string)
| 64 | } |
| 65 | |
| 66 | func runRemove(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts removeOptions, services []string) error { |
| 67 | project, name, err := opts.projectOrName(ctx, dockerCli, services...) |
| 68 | if err != nil { |
| 69 | return err |
| 70 | } |
| 71 | |
| 72 | backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...) |
| 73 | if err != nil { |
| 74 | return err |
| 75 | } |
| 76 | err = backend.Remove(ctx, name, api.RemoveOptions{ |
| 77 | Services: services, |
| 78 | Force: opts.force, |
| 79 | Volumes: opts.volumes, |
| 80 | Project: project, |
| 81 | Stop: opts.stop, |
| 82 | }) |
| 83 | if errors.Is(err, api.ErrNoResources) { |
| 84 | _, _ = fmt.Fprintln(stdinfo(dockerCli), "No stopped containers") |
| 85 | return nil |
| 86 | } |
| 87 | return err |
| 88 | } |
no test coverage detected