Codebase list docker-compose / dbe7de5
don't try to start dependencies when there are none Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com> Nicolas De Loof 2 years ago
2 changed file(s) with 12 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
244244
245245 project.Services = dependencies
246246 project.DisabledServices = append(project.DisabledServices, requestedService)
247 if err := backend.Create(ctx, &project, api.CreateOptions{
247 err := backend.Create(ctx, &project, api.CreateOptions{
248248 IgnoreOrphans: ignoreOrphans,
249 }); err != nil {
250 return err
251 }
252 return backend.Start(ctx, project.Name, api.StartOptions{})
253 }
249 })
250 if err != nil {
251 return err
252 }
253
254 if len(dependencies) > 0 {
255 return backend.Start(ctx, project.Name, api.StartOptions{})
256 }
257 return nil
258 }
9999 Name: projectName,
100100 }
101101 if len(containers) == 0 {
102 return project, errors.New("no such project: " + projectName)
102 return project, errors.Wrap(api.ErrNotFound, fmt.Sprintf("no container found for project %q", projectName))
103103 }
104104 set := map[string]*types.ServiceConfig{}
105105 for _, c := range containers {