(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts downOptions, services []string)
| 79 | } |
| 80 | |
| 81 | func runDown(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts downOptions, services []string) error { |
| 82 | project, name, err := opts.projectOrName(ctx, dockerCli, services...) |
| 83 | if err != nil { |
| 84 | return err |
| 85 | } |
| 86 | |
| 87 | var timeout *time.Duration |
| 88 | if opts.timeChanged { |
| 89 | timeoutValue := time.Duration(opts.timeout) * time.Second |
| 90 | timeout = &timeoutValue |
| 91 | } |
| 92 | backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...) |
| 93 | if err != nil { |
| 94 | return err |
| 95 | } |
| 96 | return backend.Down(ctx, name, api.DownOptions{ |
| 97 | RemoveOrphans: opts.removeOrphans, |
| 98 | Project: project, |
| 99 | Timeout: timeout, |
| 100 | Images: opts.images, |
| 101 | Volumes: opts.volumes, |
| 102 | Services: services, |
| 103 | }) |
| 104 | } |
no test coverage detected