Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit c8b708a

Browse files
committed
Fix orphans warning when running docker compose up SERVICE
Signed-off-by: Guillaume Tardif <[email protected]>
1 parent 5ddcc84 commit c8b708a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

local/compose/create.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ func (s *composeService) Create(ctx context.Context, project *types.Project, opt
7373
return err
7474
}
7575

76-
orphans := observedState.filter(isNotService(project.ServiceNames()...))
76+
allServices := project.AllServices()
77+
allServiceNames := []string{}
78+
for _, service := range allServices {
79+
allServiceNames = append(allServiceNames, service.Name)
80+
}
81+
orphans := observedState.filter(isNotService(allServiceNames...))
7782
if len(orphans) > 0 {
7883
if opts.RemoveOrphans {
7984
w := progress.ContextWriter(ctx)

0 commit comments

Comments
 (0)