diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2022-08-09 17:13:38 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2022-08-16 23:25:16 +0200 |
commit | 239d9c5eda8f65678b26de26a6763a67772f3151 (patch) | |
tree | 0140453b7dc0f50be980f09a0c72679b9c3ed662 /daemon/daemon.go | |
parent | 6ccda5a04111680544eadb6fbc916435ea073e69 (diff) | |
download | docker-239d9c5eda8f65678b26de26a6763a67772f3151.tar.gz |
daemon: restore(): remove fallback for legacy containers
The check was accounting for old containers that did not have a storage-driver
set in their config, and was added in 4908d7f81db91f4a28be152ec0cacb0cf711b403
for docker v0.7.0-rc6 - nearly 9 Years ago, so very likely nobody is still
depending on this ;-)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'daemon/daemon.go')
-rw-r--r-- | daemon/daemon.go | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/daemon/daemon.go b/daemon/daemon.go index 7a77e66e1f..f82f66204a 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -239,25 +239,25 @@ func (daemon *Daemon) restore() error { log.WithError(err).Error("failed to load container") return } - // Ignore the container if it does not support the current driver being used by the graph - if (c.Driver == "" && daemon.graphDriver == "aufs") || c.Driver == daemon.graphDriver { - rwlayer, err := daemon.imageService.GetLayerByID(c.ID) - if err != nil { - log.WithError(err).Error("failed to load container mount") - return - } - c.RWLayer = rwlayer - log.WithFields(logrus.Fields{ - "running": c.IsRunning(), - "paused": c.IsPaused(), - }).Debug("loaded container") - - mapLock.Lock() - containers[c.ID] = c - mapLock.Unlock() - } else { - log.Debugf("cannot load container because it was created with another storage driver") + if c.Driver != daemon.graphDriver { + // Ignore the container if it wasn't created with the current storage-driver + log.Debugf("not restoring container because it was created with another storage driver (%s)", c.Driver) + return + } + rwlayer, err := daemon.imageService.GetLayerByID(c.ID) + if err != nil { + log.WithError(err).Error("failed to load container mount") + return } + c.RWLayer = rwlayer + log.WithFields(logrus.Fields{ + "running": c.IsRunning(), + "paused": c.IsPaused(), + }).Debug("loaded container") + + mapLock.Lock() + containers[c.ID] = c + mapLock.Unlock() }(v.Name()) } group.Wait() |