From abcc91e2b93c2e35c3847c31a7db71061f3594f2 Mon Sep 17 00:00:00 2001 From: Suleiman Dibirov Date: Thu, 26 Sep 2024 09:16:34 +0300 Subject: [PATCH] fix(down): Fix down command if specified services are not running Signed-off-by: Suleiman Dibirov --- pkg/compose/down.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/compose/down.go b/pkg/compose/down.go index 2c2e75dc4..a9ecaeabd 100644 --- a/pkg/compose/down.go +++ b/pkg/compose/down.go @@ -67,11 +67,18 @@ func (s *composeService) down(ctx context.Context, projectName string, options a } // Check requested services exists in model - options.Services, err = checkSelectedServices(options, project) + services, err := checkSelectedServices(options, project) if err != nil { return err } + if len(options.Services) > 0 && len(services) == 0 { + logrus.Infof("Any of the services %v not running in project %q", options.Services, projectName) + return nil + } + + options.Services = services + if len(containers) > 0 { resourceToRemove = true }