Skip to content

Commit

Permalink
don't filter by services if no filter was set
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Jan 6, 2023
1 parent 96bbda9 commit eeb7eb6
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions pkg/compose/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,9 @@ func (s *composeService) Ps(ctx context.Context, projectName string, options api
return nil, err
}

project := options.Project
if project == nil {
project, err = s.getProjectWithResources(ctx, containers, projectName)
if err != nil {
return nil, err
}
if len(options.Services) != 0 {
containers = containers.filter(isService(options.Services...))
}

if len(options.Services) == 0 {
options.Services = project.ServiceNames()
}

containers = containers.filter(isService(options.Services...))
summary := make([]api.ContainerSummary, len(containers))
eg, ctx := errgroup.WithContext(ctx)
for i, container := range containers {
Expand Down

0 comments on commit eeb7eb6

Please sign in to comment.