mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Wait for container dependencies upon daemon start up
- Get dependent containers before starting containers - Dependent containers can be either from legacy link or container network - Wait on a best effort basis for the dependent containers Fixes: #50326 Signed-off-by: Adrien Pompée <adrien.pompee@atmosphere.aero>
This commit is contained in:
@@ -575,8 +575,8 @@ func (daemon *Daemon) restore(cfg *configStore) error {
|
||||
logger.Debug("starting container")
|
||||
|
||||
// ignore errors here as this is a best effort to wait for children
|
||||
// (legacy links) to be running before we try to start the container
|
||||
if children := daemon.linkIndex.children(c); len(children) > 0 {
|
||||
// (legacy links or container network) to be running before we try to start the container
|
||||
if children := daemon.GetDependentContainers(c); len(children) > 0 {
|
||||
timeout := time.NewTimer(5 * time.Second)
|
||||
defer timeout.Stop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user