getContainersByService returns all non-oneoff containers for the project, grouped by service name.
(ctx context.Context, projectName string)
| 59 | |
| 60 | // getContainersByService returns all non-oneoff containers for the project, grouped by service name. |
| 61 | func (s *composeService) getContainersByService(ctx context.Context, projectName string) (map[string]Containers, error) { |
| 62 | all, err := s.getContainers(ctx, projectName, oneOffExclude, true) |
| 63 | if err != nil { |
| 64 | return nil, err |
| 65 | } |
| 66 | result := map[string]Containers{} |
| 67 | for _, c := range all.filter(isNotOneOff) { |
| 68 | svc := c.Labels[api.ServiceLabel] |
| 69 | result[svc] = append(result[svc], c) |
| 70 | } |
| 71 | return result, nil |
| 72 | } |
| 73 | |
| 74 | func getDefaultFilters(projectName string, oneOff oneOff, selectedServices ...string) client.Filters { |
| 75 | f := projectFilter(projectName) |
no test coverage detected