소스 검색

attach _only_ to services declared by project applying profiles

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 3 년 전
부모
커밋
8d03e29994
2개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      cmd/compose/up.go
  2. 2 2
      pkg/compose/up.go

+ 3 - 0
cmd/compose/up.go

@@ -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,

+ 2 - 2
pkg/compose/up.go

@@ -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(),
 			})
 		})
 	}