runRemove removes the given Swarm configs.
(ctx context.Context, dockerCLI command.Cli, names []string)
| 27 | |
| 28 | // runRemove removes the given Swarm configs. |
| 29 | func runRemove(ctx context.Context, dockerCLI command.Cli, names []string) error { |
| 30 | apiClient := dockerCLI.Client() |
| 31 | |
| 32 | var errs []error |
| 33 | for _, name := range names { |
| 34 | if _, err := apiClient.ConfigRemove(ctx, name, client.ConfigRemoveOptions{}); err != nil { |
| 35 | errs = append(errs, err) |
| 36 | continue |
| 37 | } |
| 38 | _, _ = fmt.Fprintln(dockerCLI.Out(), name) |
| 39 | } |
| 40 | |
| 41 | return errors.Join(errs...) |
| 42 | } |
no test coverage detected
searching dependent graphs…