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

Method isServiceCompleted

pkg/compose/convergence.go:506–517  ·  view source on GitHub ↗
(ctx context.Context, containers Containers)

Source from the content-addressed store, hash-verified

504}
505
506func (s *composeService) isServiceCompleted(ctx context.Context, containers Containers) (bool, int, error) {
507 for _, c := range containers {
508 res, err := s.apiClient().ContainerInspect(ctx, c.ID, client.ContainerInspectOptions{})
509 if err != nil {
510 return false, 0, err
511 }
512 if res.Container.State != nil && res.Container.State.Status == container.StateExited {
513 return true, res.Container.State.ExitCode, nil
514 }
515 }
516 return false, 0, nil
517}
518
519func (s *composeService) startService(ctx context.Context,
520 project *types.Project, service types.ServiceConfig,

Callers 1

waitDependenciesMethod · 0.95

Calls 2

apiClientMethod · 0.95
ContainerInspectMethod · 0.45

Tested by

no test coverage detected