Merge pull request #43940 from thaJeztah/remove_legacy_graphdriver_fallback
daemon: remove some legacy fallbacks, and small refactor
This commit is contained in:
commit
031c731c68
|
@ -81,7 +81,6 @@ func (i *ImageService) Cleanup() error {
|
||||||
// GraphDriverName returns the name of the graph drvier
|
// GraphDriverName returns the name of the graph drvier
|
||||||
// moved from Daemon.GraphDriverName, used by:
|
// moved from Daemon.GraphDriverName, used by:
|
||||||
// - newContainer
|
// - newContainer
|
||||||
// - to report an error in Daemon.Mount(container)
|
|
||||||
func (i *ImageService) GraphDriverName() string {
|
func (i *ImageService) GraphDriverName() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,12 +239,11 @@ func (daemon *Daemon) restore() error {
|
||||||
log.WithError(err).Error("failed to load container")
|
log.WithError(err).Error("failed to load container")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !system.IsOSSupported(c.OS) {
|
if c.Driver != daemon.graphDriver {
|
||||||
log.Errorf("failed to load container: %s (%q)", system.ErrNotSupportedOperatingSystem, c.OS)
|
// 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
|
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)
|
rwlayer, err := daemon.imageService.GetLayerByID(c.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("failed to load container mount")
|
log.WithError(err).Error("failed to load container mount")
|
||||||
|
@ -259,9 +258,6 @@ func (daemon *Daemon) restore() error {
|
||||||
mapLock.Lock()
|
mapLock.Lock()
|
||||||
containers[c.ID] = c
|
containers[c.ID] = c
|
||||||
mapLock.Unlock()
|
mapLock.Unlock()
|
||||||
} else {
|
|
||||||
log.Debugf("cannot load container because it was created with another storage driver")
|
|
||||||
}
|
|
||||||
}(v.Name())
|
}(v.Name())
|
||||||
}
|
}
|
||||||
group.Wait()
|
group.Wait()
|
||||||
|
@ -1277,8 +1273,8 @@ func (daemon *Daemon) Mount(container *container.Container) error {
|
||||||
// on non-Windows operating systems.
|
// on non-Windows operating systems.
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
daemon.Unmount(container)
|
daemon.Unmount(container)
|
||||||
return fmt.Errorf("Error: driver %s is returning inconsistent paths for container %s ('%s' then '%s')",
|
return fmt.Errorf("driver %s is returning inconsistent paths for container %s ('%s' then '%s')",
|
||||||
daemon.imageService.GraphDriverName(), container.ID, container.BaseFS, dir)
|
container.Driver, container.ID, container.BaseFS, dir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
container.BaseFS = dir // TODO: combine these fields
|
container.BaseFS = dir // TODO: combine these fields
|
||||||
|
|
|
@ -175,7 +175,6 @@ func (i *ImageService) Cleanup() error {
|
||||||
// GraphDriverName returns the name of the graph drvier
|
// GraphDriverName returns the name of the graph drvier
|
||||||
// moved from Daemon.GraphDriverName, used by:
|
// moved from Daemon.GraphDriverName, used by:
|
||||||
// - newContainer
|
// - newContainer
|
||||||
// - to report an error in Daemon.Mount(container)
|
|
||||||
func (i *ImageService) GraphDriverName() string {
|
func (i *ImageService) GraphDriverName() string {
|
||||||
return i.layerStore.DriverName()
|
return i.layerStore.DriverName()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue