(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts restartOptions, services []string)
| 55 | } |
| 56 | |
| 57 | func runRestart(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts restartOptions, services []string) error { |
| 58 | project, name, err := opts.projectOrName(ctx, dockerCli) |
| 59 | if err != nil { |
| 60 | return err |
| 61 | } |
| 62 | |
| 63 | if project != nil && len(services) > 0 { |
| 64 | project, err = project.WithServicesEnabled(services...) |
| 65 | if err != nil { |
| 66 | return err |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | return withBackend(dockerCli, backendOptions, func(backend api.Compose) error { |
| 71 | return backend.Restart(ctx, name, api.RestartOptions{ |
| 72 | Timeout: optionalTimeout(opts.timeout, opts.timeChanged), |
| 73 | Services: services, |
| 74 | Project: project, |
| 75 | NoDeps: opts.noDeps, |
| 76 | }) |
| 77 | }) |
| 78 | } |
no test coverage detected