mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
also restart dependent services after a service has been restarted
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
1a410ffe30
commit
92e0cd4047
@ -49,7 +49,7 @@ func restartCommand(p *ProjectOptions, backend api.Service) *cobra.Command {
|
||||
}
|
||||
|
||||
func runRestart(ctx context.Context, backend api.Service, opts restartOptions, services []string) error {
|
||||
project, name, err := opts.projectOrName(services...)
|
||||
project, name, err := opts.projectOrName()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -48,14 +48,14 @@ func (s *composeService) restart(ctx context.Context, projectName string, option
|
||||
}
|
||||
|
||||
if len(options.Services) == 0 {
|
||||
options.Services = project.ServiceNames()
|
||||
err = project.ForServices(options.Services)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
w := progress.ContextWriter(ctx)
|
||||
return InDependencyOrder(ctx, project, func(c context.Context, service string) error {
|
||||
if !utils.StringContains(options.Services, service) {
|
||||
return nil
|
||||
}
|
||||
eg, ctx := errgroup.WithContext(ctx)
|
||||
for _, container := range containers.filter(isService(service)) {
|
||||
container := container
|
||||
|
Loading…
x
Reference in New Issue
Block a user