From 9d74c7ab9993719ed5f45e492d393f0ad923b536 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 9 Aug 2022 17:25:48 +0200 Subject: [PATCH] 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 --- daemon/containerd/service.go | 1 - daemon/daemon.go | 4 ++-- daemon/images/service.go | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/daemon/containerd/service.go b/daemon/containerd/service.go index 2604daec29..17ca48fdca 100644 --- a/daemon/containerd/service.go +++ b/daemon/containerd/service.go @@ -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 "" } diff --git a/daemon/daemon.go b/daemon/daemon.go index f82f66204a..b73d9e76d2 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -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 diff --git a/daemon/images/service.go b/daemon/images/service.go index c23e878cf3..461cb7cb82 100644 --- a/daemon/images/service.go +++ b/daemon/images/service.go @@ -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() }