attach _only_ to services declared by project applying profiles

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2022-05-20 10:36:06 +02:00
parent 7e3564b7ad
commit 8d03e29994
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 5 additions and 2 deletions

View File

@ -185,6 +185,9 @@ func runUp(ctx context.Context, backend api.Service, createOptions createOptions
if upOptions.attachDependencies {
attachTo = project.ServiceNames()
}
if len(attachTo) == 0 {
attachTo = project.ServiceNames()
}
create := api.CreateOptions{
Services: services,

View File

@ -61,12 +61,12 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
go func() {
<-signalChan
s.Kill(ctx, project.Name, api.KillOptions{ // nolint:errcheck
Services: options.Create.Services,
Services: project.ServiceNames(),
})
}()
return s.Stop(ctx, project.Name, api.StopOptions{
Services: options.Create.Services,
Services: project.ServiceNames(),
})
})
}