From 8dd14509d76523d4e4e6abe6d11b11469d9bd34a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 9 Aug 2022 17:03:50 +0200 Subject: [PATCH] ImageService: rename GraphDriverName to StorageDriver Make the function name more generic, as it's no longer used only for graphdrivers but also for snapshotters. Signed-off-by: Sebastiaan van Stijn --- daemon/container.go | 2 +- daemon/containerd/service.go | 7 +++---- daemon/image_service.go | 2 +- daemon/images/service.go | 6 ++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/daemon/container.go b/daemon/container.go index dd752f2b44..d21b3386e1 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -154,7 +154,7 @@ func (daemon *Daemon) newContainer(name string, operatingSystem string, config * base.ImageID = imgID base.NetworkSettings = &network.Settings{IsAnonymousEndpoint: noExplicitName} base.Name = name - base.Driver = daemon.imageService.GraphDriverName() + base.Driver = daemon.imageService.StorageDriver() base.OS = operatingSystem return base, err } diff --git a/daemon/containerd/service.go b/daemon/containerd/service.go index 17ca48fdca..1cb55bae1f 100644 --- a/daemon/containerd/service.go +++ b/daemon/containerd/service.go @@ -78,10 +78,9 @@ func (i *ImageService) Cleanup() error { return nil } -// GraphDriverName returns the name of the graph drvier -// moved from Daemon.GraphDriverName, used by: -// - newContainer -func (i *ImageService) GraphDriverName() string { +// StorageDriver returns the name of the default storage-driver (snapshotter) +// used by the ImageService. +func (i *ImageService) StorageDriver() string { return "" } diff --git a/daemon/image_service.go b/daemon/image_service.go index 0db2afda3b..cb0bb8dc5e 100644 --- a/daemon/image_service.go +++ b/daemon/image_service.go @@ -72,6 +72,6 @@ type ImageService interface { DistributionServices() images.DistributionServices Children(id image.ID) []image.ID Cleanup() error - GraphDriverName() string + StorageDriver() string UpdateConfig(maxDownloads, maxUploads int) } diff --git a/daemon/images/service.go b/daemon/images/service.go index 461cb7cb82..474b75e42a 100644 --- a/daemon/images/service.go +++ b/daemon/images/service.go @@ -172,10 +172,8 @@ func (i *ImageService) Cleanup() error { return nil } -// GraphDriverName returns the name of the graph drvier -// moved from Daemon.GraphDriverName, used by: -// - newContainer -func (i *ImageService) GraphDriverName() string { +// StorageDriver returns the name of the storage driver used by the ImageService. +func (i *ImageService) StorageDriver() string { return i.layerStore.DriverName() }