Skip to content

Commit

Permalink
fix(down): Fix down command if specified services are not running
Browse files Browse the repository at this point in the history
Signed-off-by: Suleiman Dibirov <[email protected]>
  • Loading branch information
idsulik authored and ndeloof committed Sep 26, 2024
1 parent 8b9fe89 commit abcc91e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/compose/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit abcc91e

Please sign in to comment.