mirror of https://github.com/docker/compose.git
make code simpler
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
e99b8acea7
commit
c525373acb
|
@ -127,13 +127,7 @@ func isNotService(services ...string) containerPredicate {
|
||||||
|
|
||||||
// isOrphaned is a predicate to select containers without a matching service definition in compose project
|
// isOrphaned is a predicate to select containers without a matching service definition in compose project
|
||||||
func isOrphaned(project *types.Project) containerPredicate {
|
func isOrphaned(project *types.Project) containerPredicate {
|
||||||
var services []string
|
services := append(project.ServiceNames(), project.DisabledServiceNames()...)
|
||||||
for _, s := range project.Services {
|
|
||||||
services = append(services, s.Name)
|
|
||||||
}
|
|
||||||
for _, s := range project.DisabledServices {
|
|
||||||
services = append(services, s.Name)
|
|
||||||
}
|
|
||||||
return func(c moby.Container) bool {
|
return func(c moby.Container) bool {
|
||||||
service := c.Labels[api.ServiceLabel]
|
service := c.Labels[api.ServiceLabel]
|
||||||
return !utils.StringContains(services, service)
|
return !utils.StringContains(services, service)
|
||||||
|
|
Loading…
Reference in New Issue