(ctx context.Context, dockerCli command.Cli, opts configOptions)
| 348 | } |
| 349 | |
| 350 | func runServices(ctx context.Context, dockerCli command.Cli, opts configOptions) error { |
| 351 | if opts.noInterpolate { |
| 352 | // we can't use ToProject, so the model we render here is only partially resolved |
| 353 | data, err := opts.ToModel(ctx, dockerCli, nil, cli.WithoutEnvironmentResolution) |
| 354 | if err != nil { |
| 355 | return err |
| 356 | } |
| 357 | |
| 358 | if _, ok := data["services"]; ok { |
| 359 | for serviceName := range data["services"].(map[string]any) { |
| 360 | _, _ = fmt.Fprintln(dockerCli.Out(), serviceName) |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | return nil |
| 365 | } |
| 366 | |
| 367 | backend, err := compose.NewComposeService(dockerCli) |
| 368 | if err != nil { |
| 369 | return err |
| 370 | } |
| 371 | |
| 372 | project, _, err := opts.ProjectOptions.ToProject(ctx, dockerCli, backend, nil, cli.WithoutEnvironmentResolution) |
| 373 | if err != nil { |
| 374 | return err |
| 375 | } |
| 376 | err = project.ForEachService(project.ServiceNames(), func(serviceName string, _ *types.ServiceConfig) error { |
| 377 | _, _ = fmt.Fprintln(dockerCli.Out(), serviceName) |
| 378 | return nil |
| 379 | }) |
| 380 | |
| 381 | return err |
| 382 | } |
| 383 | |
| 384 | func runVolumes(ctx context.Context, dockerCli command.Cli, opts configOptions) error { |
| 385 | backend, err := compose.NewComposeService(dockerCli) |
no test coverage detected