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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-08-09 17:03:50 +02:00
parent 031c731c68
commit 8dd14509d7
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
4 changed files with 7 additions and 10 deletions

View File

@ -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
}

View File

@ -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 ""
}

View File

@ -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)
}

View File

@ -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()
}