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 4908d7f81d
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>
This commit is contained in:
Sebastiaan van Stijn 2022-08-09 17:13:38 +02:00
parent 6ccda5a041
commit 239d9c5eda
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -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()