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:
parent
065960386f
commit
2e50006f1c
5 changed files with 31 additions and 95 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue