Skip to content

Commit

Permalink
Merge pull request #11535 from ndeloof/simpler
Browse files Browse the repository at this point in the history
make code simpler
  • Loading branch information
glours committed Mar 1, 2024
2 parents e99b8ac + c525373 commit a7acf5f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/compose/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,7 @@ func isNotService(services ...string) containerPredicate {

// isOrphaned is a predicate to select containers without a matching service definition in compose project
func isOrphaned(project *types.Project) containerPredicate {
var services []string
for _, s := range project.Services {
services = append(services, s.Name)
}
for _, s := range project.DisabledServices {
services = append(services, s.Name)
}
services := append(project.ServiceNames(), project.DisabledServiceNames()...)
return func(c moby.Container) bool {
service := c.Labels[api.ServiceLabel]
return !utils.StringContains(services, service)
Expand Down

0 comments on commit a7acf5f

Please sign in to comment.