Avoid using lower-level storage APIs

Switch from using the lower-level storage APIs (accessing LayerStore,
ImageStore, and ContainerStore types directly) in favor of the
higher-level ones that take care of synchronization and locking for us.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai 2017-07-24 11:14:18 -04:00
parent 065960386f
commit 2e50006f1c
5 changed files with 31 additions and 95 deletions

View file

@ -112,15 +112,11 @@ func GetImageData(store storage.Store, name string) (*ImageData, error) {
return nil, err
}
lstore, err := store.LayerStore()
layer, err := store.Layer(topLayerID)
if err != nil {
return nil, err
}
layer, err := lstore.Get(topLayerID)
if err != nil {
return nil, err
}
size, err := lstore.DiffSize(layer.Parent, layer.ID)
size, err := store.DiffSize(layer.Parent, layer.ID)
if err != nil {
return nil, err
}