mirror of https://github.com/docker/compose.git
prevent concurrent map write relying on project immutability
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
bf1dd0c267
commit
fd1f73a5e7
|
@ -56,13 +56,16 @@ func (s *composeService) restart(ctx context.Context, projectName string, option
|
|||
}
|
||||
|
||||
// ignore depends_on relations which are not impacted by restarting service or not required
|
||||
for i, service := range project.Services {
|
||||
for name, r := range service.DependsOn {
|
||||
project, err = project.WithServicesTransform(func(name string, s types.ServiceConfig) (types.ServiceConfig, error) {
|
||||
for name, r := range s.DependsOn {
|
||||
if !r.Restart {
|
||||
delete(service.DependsOn, name)
|
||||
delete(s.DependsOn, name)
|
||||
}
|
||||
}
|
||||
project.Services[i] = service
|
||||
return s, nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(options.Services) != 0 {
|
||||
|
|
Loading…
Reference in New Issue