summaryrefslogtreecommitdiff
path: root/libpod/driver
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-05-21 16:42:41 -0400
committerMatthew Heon <mcs@bellerophon.lldp.net>2019-06-03 15:54:53 -0400
commit1be345bd9d82ac64d7ae3ceea41f72329f7bdebf (patch)
tree6339a03fd92edb07e694fd43c690c82a3b8ee006 /libpod/driver
parent7c465d4d9738f25546d61b915d63bf8fff0ed14d (diff)
downloadpodman-1be345bd9d82ac64d7ae3ceea41f72329f7bdebf.tar.gz
podman-1be345bd9d82ac64d7ae3ceea41f72329f7bdebf.tar.bz2
podman-1be345bd9d82ac64d7ae3ceea41f72329f7bdebf.zip
Begin to break up pkg/inspect
Let's put inspect structs where they're actually being used. We originally made pkg/inspect to solve circular import issues. There are no more circular import issues. Image structs remain for now, I'm focusing on container inspect. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/driver')
-rw-r--r--libpod/driver/driver.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/libpod/driver/driver.go b/libpod/driver/driver.go
index 717ac2a4d..f9442fa21 100644
--- a/libpod/driver/driver.go
+++ b/libpod/driver/driver.go
@@ -1,10 +1,15 @@
package driver
import (
- "github.com/containers/libpod/pkg/inspect"
cstorage "github.com/containers/storage"
)
+// Data handles the data for a storage driver
+type Data struct {
+ Name string `json:"Name"`
+ Data map[string]string `json:"Data"`
+}
+
// GetDriverName returns the name of the driver for the given store
func GetDriverName(store cstorage.Store) (string, error) {
driver, err := store.GraphDriver()
@@ -24,7 +29,7 @@ func GetDriverMetadata(store cstorage.Store, layerID string) (map[string]string,
}
// GetDriverData returns the Data struct with information of the driver used by the store
-func GetDriverData(store cstorage.Store, layerID string) (*inspect.Data, error) {
+func GetDriverData(store cstorage.Store, layerID string) (*Data, error) {
name, err := GetDriverName(store)
if err != nil {
return nil, err
@@ -33,7 +38,7 @@ func GetDriverData(store cstorage.Store, layerID string) (*inspect.Data, error)
if err != nil {
return nil, err
}
- return &inspect.Data{
+ return &Data{
Name: name,
Data: metaData,
}, nil