Skip to content

Commit 644f698

Browse files
committed
only monitor attached services on up command
Signed-off-by: Guillaume Lours <[email protected]>
1 parent 91a6eaf commit 644f698

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pkg/compose/up.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,8 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
165165
}
166166

167167
monitor := newMonitor(s.apiClient(), project.Name)
168-
if len(options.Start.Services) > 0 {
169-
monitor.withServices(options.Start.Services)
170-
} else {
171-
monitor.withServices(project.ServiceNames())
172-
}
168+
// Start.AttachTo have been already curated with only the services to monitor
169+
monitor.withServices(options.Start.AttachTo)
173170
monitor.withListener(printer.HandleEvent)
174171

175172
var exitCode int
@@ -228,6 +225,7 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
228225
if slices.Contains(attached, event.ID) {
229226
return
230227
}
228+
231229
eg.Go(func() error {
232230
ctr, err := s.apiClient().ContainerInspect(ctx, event.ID)
233231
if err != nil {

0 commit comments

Comments
 (0)