|
|
@@ -35,15 +35,18 @@ func (s *composeService) Start(ctx context.Context, projectName string, options
|
|
|
}
|
|
|
|
|
|
func (s *composeService) start(ctx context.Context, projectName string, options api.StartOptions, listener api.ContainerEventListener) error {
|
|
|
- var containers Containers
|
|
|
- containers, err := s.getContainers(ctx, projectName, oneOffExclude, true)
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
+ project := options.Project
|
|
|
+ if project == nil {
|
|
|
+ var containers Containers
|
|
|
+ containers, err := s.getContainers(ctx, projectName, oneOffExclude, true)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
|
|
|
- project, err := s.projectFromName(containers, projectName, options.AttachTo...)
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
+ project, err = s.projectFromName(containers, projectName, options.AttachTo...)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
eg, ctx := errgroup.WithContext(ctx)
|
|
|
@@ -60,7 +63,7 @@ func (s *composeService) start(ctx context.Context, projectName string, options
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- err = InDependencyOrder(ctx, project, func(c context.Context, name string) error {
|
|
|
+ err := InDependencyOrder(ctx, project, func(c context.Context, name string) error {
|
|
|
service, err := project.GetService(name)
|
|
|
if err != nil {
|
|
|
return err
|