summaryrefslogtreecommitdiff
path: root/libpod/driver/driver.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-12-13 09:36:14 -0500
committerGitHub <noreply@github.com>2017-12-13 09:36:14 -0500
commite456c07813c5ccc6ccc81ad9a103e46e1b59b50c (patch)
tree06d6976ab80d77d19393f81344ef092fa9e51a3f /libpod/driver/driver.go
parentcfb4e15e430e63b17420e80c0f6030a12fa1fb4a (diff)
parent74ee579375654c79fa710f13b7c2ee3810366f82 (diff)
downloadpodman-e456c07813c5ccc6ccc81ad9a103e46e1b59b50c.tar.gz
podman-e456c07813c5ccc6ccc81ad9a103e46e1b59b50c.tar.bz2
podman-e456c07813c5ccc6ccc81ad9a103e46e1b59b50c.zip
Merge pull request #106 from umohnani8/kpod_inspect
Update kpod inspect to use the new container state
Diffstat (limited to 'libpod/driver/driver.go')
-rw-r--r--libpod/driver/driver.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/libpod/driver/driver.go b/libpod/driver/driver.go
index 4db55852c..8475810a8 100644
--- a/libpod/driver/driver.go
+++ b/libpod/driver/driver.go
@@ -4,8 +4,8 @@ import cstorage "github.com/containers/storage"
// Data handles the data for a storage driver
type Data struct {
- Name string
- Data map[string]string
+ Name string `json:"Name"`
+ Data map[string]string `json:"Data"`
}
// GetDriverName returns the name of the driver for the given store
@@ -25,3 +25,19 @@ func GetDriverMetadata(store cstorage.Store, layerID string) (map[string]string,
}
return driver.Metadata(layerID)
}
+
+// GetDriverData returns the Data struct with information of the driver used by the store
+func GetDriverData(store cstorage.Store, layerID string) (*Data, error) {
+ name, err := GetDriverName(store)
+ if err != nil {
+ return nil, err
+ }
+ metaData, err := GetDriverMetadata(store, layerID)
+ if err != nil {
+ return nil, err
+ }
+ return &Data{
+ Name: name,
+ Data: metaData,
+ }, nil
+}