mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Move call to Daemon.registerLinks out of Daemon.setHostConfig
The call from Daemon.create -> Daemon.setHostConfig acquired container.Lock, but didn't need to because the container is newly created and solely owned by the caller. The call from Daemon.restore did not acquire the lock. Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
@@ -247,7 +247,9 @@ func (daemon *Daemon) create(ctx context.Context, daemonCfg *config.Config, opts
|
||||
if err := daemon.setHostConfig(ctr, opts.params.HostConfig, opts.params.DefaultReadOnlyNonRecursive); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := daemon.registerLinks(ctr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := daemon.createContainerOSSpecificSettings(ctx, ctr, opts.params.Config, opts.params.HostConfig); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user