MCPcopy
hub / github.com/docker/compose / runModels

Function runModels

cmd/compose/config.go:416–432  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, opts configOptions)

Source from the content-addressed store, hash-verified

414}
415
416func runModels(ctx context.Context, dockerCli command.Cli, opts configOptions) error {
417 backend, err := compose.NewComposeService(dockerCli)
418 if err != nil {
419 return err
420 }
421
422 project, _, err := opts.ProjectOptions.ToProject(ctx, dockerCli, backend, nil, cli.WithoutEnvironmentResolution)
423 if err != nil {
424 return err
425 }
426 for _, model := range project.Models {
427 if model.Model != "" {
428 _, _ = fmt.Fprintln(dockerCli.Out(), model.Model)
429 }
430 }
431 return nil
432}
433
434func runHash(ctx context.Context, dockerCli command.Cli, opts configOptions) error {
435 var services []string

Callers 1

configCommandFunction · 0.85

Calls 3

NewComposeServiceFunction · 0.92
ToProjectMethod · 0.45
OutMethod · 0.45

Tested by

no test coverage detected