From a752ef0cf458f17e9c0690cbd4f045f14339bddc Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Fri, 6 Jan 2023 16:30:16 +0100 Subject: [PATCH] don't filter by services if no filter was set Signed-off-by: Nicolas De Loof --- pkg/compose/ps.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/compose/ps.go b/pkg/compose/ps.go index 80cbfca2bc8..14d1b879230 100644 --- a/pkg/compose/ps.go +++ b/pkg/compose/ps.go @@ -45,11 +45,9 @@ func (s *composeService) Ps(ctx context.Context, projectName string, options api } } - if len(options.Services) == 0 { - options.Services = project.ServiceNames() + if len(options.Services) != 0 { + containers = containers.filter(isService(options.Services...)) } - - containers = containers.filter(isService(options.Services...)) summary := make([]api.ContainerSummary, len(containers)) eg, ctx := errgroup.WithContext(ctx) for i, container := range containers {