Remove jsonData argument from image.StoreImage

The argument specified the json data to save to disk when registering
a new image into the image graph. If it is nil, then the given image
is serialized to json and that is written by default. This default
behavior is sufficient if the given image was originally deserialzed
from this jsonData to begin with which has always been the case.

Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 26184de8ab1dfe812094c55c9becd8ebb60ed7be
Component: engine
This commit is contained in:
Josh Hawn
2014-10-27 11:00:29 -07:00
parent d5e3aaa45d
commit ade837e2a4
7 changed files with 23 additions and 29 deletions

View File

@ -132,14 +132,14 @@ func (graph *Graph) Create(layerData archive.ArchiveReader, containerID, contain
img.ContainerConfig = *containerConfig
}
if err := graph.Register(img, nil, layerData); err != nil {
if err := graph.Register(img, layerData); err != nil {
return nil, err
}
return img, nil
}
// Register imports a pre-existing image into the graph.
func (graph *Graph) Register(img *image.Image, jsonData []byte, layerData archive.ArchiveReader) (err error) {
func (graph *Graph) Register(img *image.Image, layerData archive.ArchiveReader) (err error) {
defer func() {
// If any error occurs, remove the new dir from the driver.
// Don't check for errors since the dir might not have been created.
@ -181,7 +181,7 @@ func (graph *Graph) Register(img *image.Image, jsonData []byte, layerData archiv
}
// Apply the diff/layer
img.SetGraph(graph)
if err := image.StoreImage(img, jsonData, layerData, tmp); err != nil {
if err := image.StoreImage(img, layerData, tmp); err != nil {
return err
}
// Commit