(ctx context.Context, dockerCli command.Cli, opts configOptions)
| 432 | } |
| 433 | |
| 434 | func runHash(ctx context.Context, dockerCli command.Cli, opts configOptions) error { |
| 435 | var services []string |
| 436 | if opts.hash != "*" { |
| 437 | services = append(services, strings.Split(opts.hash, ",")...) |
| 438 | } |
| 439 | |
| 440 | backend, err := compose.NewComposeService(dockerCli) |
| 441 | if err != nil { |
| 442 | return err |
| 443 | } |
| 444 | |
| 445 | project, _, err := opts.ProjectOptions.ToProject(ctx, dockerCli, backend, nil, cli.WithoutEnvironmentResolution) |
| 446 | if err != nil { |
| 447 | return err |
| 448 | } |
| 449 | |
| 450 | if err := applyPlatforms(project, true); err != nil { |
| 451 | return err |
| 452 | } |
| 453 | |
| 454 | if len(services) == 0 { |
| 455 | services = project.ServiceNames() |
| 456 | } |
| 457 | |
| 458 | sorted := services |
| 459 | slices.Sort(sorted) |
| 460 | |
| 461 | for _, name := range sorted { |
| 462 | s, err := project.GetService(name) |
| 463 | if err != nil { |
| 464 | return err |
| 465 | } |
| 466 | |
| 467 | hash, err := compose.ServiceHash(s) |
| 468 | if err != nil { |
| 469 | return err |
| 470 | } |
| 471 | _, _ = fmt.Fprintf(dockerCli.Out(), "%s %s\n", name, hash) |
| 472 | } |
| 473 | return nil |
| 474 | } |
| 475 | |
| 476 | func runProfiles(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) error { |
| 477 | set := map[string]struct{}{} |
no test coverage detected