mirror of
https://github.com/docker/compose.git
synced 2025-07-23 05:34:36 +02:00
fix(down): Fix down command if specified services are not running
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
This commit is contained in:
parent
8b9fe89842
commit
abcc91e2b9
@ -67,11 +67,18 @@ func (s *composeService) down(ctx context.Context, projectName string, options a
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check requested services exists in model
|
// Check requested services exists in model
|
||||||
options.Services, err = checkSelectedServices(options, project)
|
services, err := checkSelectedServices(options, project)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 {
|
if len(containers) > 0 {
|
||||||
resourceToRemove = true
|
resourceToRemove = true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user