daemon: Mount(): use container's driver information for error-message

Use the information stored as part of the container for the error-message,
instead of querying the current storage driver from the daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-08-09 17:25:48 +02:00
parent 239d9c5eda
commit 9d74c7ab99
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 2 additions and 4 deletions

View file

@ -81,7 +81,6 @@ func (i *ImageService) Cleanup() error {
// GraphDriverName returns the name of the graph drvier
// moved from Daemon.GraphDriverName, used by:
// - newContainer
// - to report an error in Daemon.Mount(container)
func (i *ImageService) GraphDriverName() string {
return ""
}

View file

@ -1273,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

View file

@ -175,7 +175,6 @@ func (i *ImageService) Cleanup() error {
// GraphDriverName returns the name of the graph drvier
// moved from Daemon.GraphDriverName, used by:
// - newContainer
// - to report an error in Daemon.Mount(container)
func (i *ImageService) GraphDriverName() string {
return i.layerStore.DriverName()
}