(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string)
| 474 | } |
| 475 | |
| 476 | func runProfiles(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) error { |
| 477 | set := map[string]struct{}{} |
| 478 | |
| 479 | backend, err := compose.NewComposeService(dockerCli) |
| 480 | if err != nil { |
| 481 | return err |
| 482 | } |
| 483 | |
| 484 | project, err := opts.ToProject(ctx, dockerCli, backend, services) |
| 485 | if err != nil { |
| 486 | return err |
| 487 | } |
| 488 | for _, s := range project.AllServices() { |
| 489 | for _, p := range s.Profiles { |
| 490 | set[p] = struct{}{} |
| 491 | } |
| 492 | } |
| 493 | profiles := make([]string, 0, len(set)) |
| 494 | for p := range set { |
| 495 | profiles = append(profiles, p) |
| 496 | } |
| 497 | sort.Strings(profiles) |
| 498 | for _, p := range profiles { |
| 499 | _, _ = fmt.Fprintln(dockerCli.Out(), p) |
| 500 | } |
| 501 | return nil |
| 502 | } |
| 503 | |
| 504 | func runConfigImages(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) error { |
| 505 | backend, err := compose.NewComposeService(dockerCli) |
no test coverage detected