From 4b0389238fc061d46d099f441c6f5230409914d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Wed, 10 Aug 2022 16:19:48 +0200 Subject: [PATCH] daemon: Fix not initialized network controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- daemon/daemon.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index e1c2e50f0f2bc..6a0c4dbd7c622 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -8,6 +8,7 @@ package daemon // import "github.com/docker/docker/daemon" import ( "context" "fmt" + "io/fs" "net" "net/url" "os" @@ -204,11 +205,6 @@ func (daemon *Daemon) RegistryHosts() docker.RegistryHosts { } func (daemon *Daemon) restore(ctx context.Context) error { - // Restoring containers after a restart is not yet supported - // when using the containerd content store. - if daemon.UsesSnapshotter() { - return nil - } var mapLock sync.Mutex containers := make(map[string]*container.Container) @@ -219,6 +215,12 @@ func (daemon *Daemon) restore(ctx context.Context) error { return err } + // Restoring containers after a restart is not yet supported + // when using the containerd content store. + if daemon.UsesSnapshotter() { + dir = []fs.DirEntry{} + } + // parallelLimit is the maximum number of parallel startup jobs that we // allow (this is the limited used for all startup semaphores). The multipler // (128) was chosen after some fairly significant benchmarking -- don't change