Update manifest format to rename blobsums and use arrays of dictionaries

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 15d5c7f10f56faeaa04f6374341e1cfd3e03cab1
Component: engine
This commit is contained in:
Derek McGowan
2014-10-10 16:04:29 -07:00
parent c77de695cd
commit 5ab2b8482f
2 changed files with 20 additions and 12 deletions
+6 -6
View File
@@ -458,7 +458,7 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri
return false, fmt.Errorf("error verifying manifest: %s", err)
}
if len(manifest.BlobSums) != len(manifest.History) {
if len(manifest.FSLayers) != len(manifest.History) {
return false, fmt.Errorf("length of history not equal to number of layers")
}
@@ -468,16 +468,16 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri
out.Write(sf.FormatStatus(tag, "Pulling from %s", localName))
}
if len(manifest.BlobSums) == 0 {
if len(manifest.FSLayers) == 0 {
return false, fmt.Errorf("no blobSums in manifest")
}
downloads := make([]downloadInfo, len(manifest.BlobSums))
downloads := make([]downloadInfo, len(manifest.FSLayers))
for i := len(manifest.BlobSums) - 1; i >= 0; i-- {
for i := len(manifest.FSLayers) - 1; i >= 0; i-- {
var (
sumStr = manifest.BlobSums[i]
imgJSON = []byte(manifest.History[i])
sumStr = manifest.FSLayers[i].BlobSum
imgJSON = []byte(manifest.History[i].V1Compatibility)
)
img, err := image.NewImgJSON(imgJSON)
+14 -6
View File
@@ -32,13 +32,21 @@ type RegistryInfo struct {
Standalone bool `json:"standalone"`
}
type FSLayer struct {
BlobSum string `json:"blobSum"`
}
type ManifestHistory struct {
V1Compatibility string `json:"v1Compatibility"`
}
type ManifestData struct {
Name string `json:"name"`
Tag string `json:"tag"`
Architecture string `json:"architecture"`
BlobSums []string `json:"blobSums"`
History []string `json:"history"`
SchemaVersion int `json:"schemaVersion"`
Name string `json:"name"`
Tag string `json:"tag"`
Architecture string `json:"architecture"`
FSLayers []*FSLayer `json:"fsLayers"`
History []*ManifestHistory `json:"history"`
SchemaVersion int `json:"schemaVersion"`
}
type APIVersion int