(ctx context.Context, dockerCLI command.Cli, opts *pauseOptions)
| 40 | } |
| 41 | |
| 42 | func runPause(ctx context.Context, dockerCLI command.Cli, opts *pauseOptions) error { |
| 43 | apiClient := dockerCLI.Client() |
| 44 | errChan := parallelOperation(ctx, opts.containers, func(ctx context.Context, container string) error { |
| 45 | _, err := apiClient.ContainerPause(ctx, container, client.ContainerPauseOptions{}) |
| 46 | return err |
| 47 | }) |
| 48 | |
| 49 | var errs []error |
| 50 | for _, ctr := range opts.containers { |
| 51 | if err := <-errChan; err != nil { |
| 52 | errs = append(errs, err) |
| 53 | continue |
| 54 | } |
| 55 | _, _ = fmt.Fprintln(dockerCLI.Out(), ctr) |
| 56 | } |
| 57 | return errors.Join(errs...) |
| 58 | } |
no test coverage detected
searching dependent graphs…