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
244 | 244 |
|
245 | 245 |
project.Services = dependencies
|
246 | 246 |
project.DisabledServices = append(project.DisabledServices, requestedService)
|
247 | |
if err := backend.Create(ctx, &project, api.CreateOptions{
|
|
247 |
err := backend.Create(ctx, &project, api.CreateOptions{
|
248 | 248 |
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 |
}
|
99 | 99 |
Name: projectName,
|
100 | 100 |
}
|
101 | 101 |
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))
|
103 | 103 |
}
|
104 | 104 |
set := map[string]*types.ServiceConfig{}
|
105 | 105 |
for _, c := range containers {
|