Merge pull request #9488 from ndeloof/attach_profiles

attach _only_ to services declared by project applying profiles
This commit is contained in:
Guillaume Lours 2022-05-20 14:38:08 +02:00 committed by GitHub
commit 9cae9eb0fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 { if upOptions.attachDependencies {
attachTo = project.ServiceNames() attachTo = project.ServiceNames()
} }
if len(attachTo) == 0 {
attachTo = project.ServiceNames()
}
create := api.CreateOptions{ create := api.CreateOptions{
Services: services, Services: services,

View File

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