Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework how we use storage for storing images
This patch overhauls how we use containers/storage to store images, dropping most of our own metadata in favor of facilities that are now provided by default by the storage library. Additionally: * storageImageDestination now caches blobs in a temporary directory until Commit() is called * storageImageDestination generates a barebones manifest if one isn't supplied before Commit() is called * storageImageDestination uses new APIs in containers/storage to look for a local layer with the same contents of a blob, making it better at noticing when a PutBlob() isn't necessary * storageImageDestination sets the creation date for the image if it can be determined during Commit() * storageImageDestination defaults to using the hex part of the digest of the image's configuration blob as an image's ID, making it better at catching re-pulls of the same image * storageImageDestination no longer discards names which have been set for an image when reusing an ID * storageImage now counts sizes of uncompressed data when determining image size * storageImage now counts the size of the configuration blob when computing an image's size * storageImage returns an updated image with the manifest listing uncompressed layer blobs * storageImageSource also returns such an updated manifest * storageImageSource now always returns uncompressed layers Test changes: * storage tests now always write an image manifest * the test for determining an image's size now actually writes the configuration blob that it later tries to read Signed-off-by: Nalin Dahyabhai <[email protected]>
- Loading branch information