mirror of
https://github.com/docker/compose.git
synced 2025-07-24 22:24:41 +02:00
don't try to start dependencies when there are none
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
fcff39631a
commit
dbe7de50a7
@ -245,10 +245,15 @@ func startDependencies(ctx context.Context, backend api.Service, project types.P
|
|||||||
|
|
||||||
project.Services = dependencies
|
project.Services = dependencies
|
||||||
project.DisabledServices = append(project.DisabledServices, requestedService)
|
project.DisabledServices = append(project.DisabledServices, requestedService)
|
||||||
if err := backend.Create(ctx, &project, api.CreateOptions{
|
err := backend.Create(ctx, &project, api.CreateOptions{
|
||||||
IgnoreOrphans: ignoreOrphans,
|
IgnoreOrphans: ignoreOrphans,
|
||||||
}); err != nil {
|
})
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return backend.Start(ctx, project.Name, api.StartOptions{})
|
|
||||||
|
if len(dependencies) > 0 {
|
||||||
|
return backend.Start(ctx, project.Name, api.StartOptions{})
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ func (s *composeService) projectFromName(containers Containers, projectName stri
|
|||||||
Name: projectName,
|
Name: projectName,
|
||||||
}
|
}
|
||||||
if len(containers) == 0 {
|
if len(containers) == 0 {
|
||||||
return project, errors.New("no such project: " + projectName)
|
return project, errors.Wrap(api.ErrNotFound, fmt.Sprintf("no container found for project %q", projectName))
|
||||||
}
|
}
|
||||||
set := map[string]*types.ServiceConfig{}
|
set := map[string]*types.ServiceConfig{}
|
||||||
for _, c := range containers {
|
for _, c := range containers {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user