зеркало из https://github.com/microsoft/docker.git
Update manifest format to rename blobsums and use arrays of dictionaries
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Родитель
456f493659
Коммит
15d5c7f10f
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче