|
@@ -239,29 +239,25 @@ func (daemon *Daemon) restore() error {
|
|
|
log.WithError(err).Error("failed to load container")
|
|
|
return
|
|
|
}
|
|
|
- if !system.IsOSSupported(c.OS) {
|
|
|
- log.Errorf("failed to load container: %s (%q)", system.ErrNotSupportedOperatingSystem, c.OS)
|
|
|
+ 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
|
|
|
}
|
|
|
- // 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")
|
|
|
+ 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()
|
|
@@ -1277,8 +1273,8 @@ func (daemon *Daemon) Mount(container *container.Container) error {
|
|
|
// on non-Windows operating systems.
|
|
|
if runtime.GOOS != "windows" {
|
|
|
daemon.Unmount(container)
|
|
|
- return fmt.Errorf("Error: driver %s is returning inconsistent paths for container %s ('%s' then '%s')",
|
|
|
- daemon.imageService.GraphDriverName(), container.ID, container.BaseFS, dir)
|
|
|
+ return fmt.Errorf("driver %s is returning inconsistent paths for container %s ('%s' then '%s')",
|
|
|
+ container.Driver, container.ID, container.BaseFS, dir)
|
|
|
}
|
|
|
}
|
|
|
container.BaseFS = dir // TODO: combine these fields
|