Skip to content

Commit

Permalink
Merge branch 'vbatts-v2_hacking' of github.com:vbatts/docker into vba…
Browse files Browse the repository at this point in the history
…tts-v2_hacking
  • Loading branch information
vbatts committed Aug 29, 2014
2 parents e710880 + b773296 commit 3726654
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
13 changes: 6 additions & 7 deletions graph/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func (s *TagStore) CmdManifest(job *engine.Job) engine.Status {
return job.Error(err)
}

manifest := map[string]interface{}{
"name": remoteName,
"tag": tag,
manifest := &registry.ManifestData{
Name: remoteName,
Tag: tag,
}
localRepo, exists := s.Repositories[name]
if !exists {
Expand All @@ -46,7 +46,7 @@ func (s *TagStore) CmdManifest(job *engine.Job) engine.Status {
layersSeen := make(map[string]bool)

layer, err := s.graph.Get(layerId)
manifest["architecture"] = layer.Architecture
manifest.Architecture = layer.Architecture
var metadata runconfig.Config
metadata = *layer.Config
history := make(map[string]string)
Expand Down Expand Up @@ -86,9 +86,8 @@ func (s *TagStore) CmdManifest(job *engine.Job) engine.Status {
history[tarId] = string(jsonData)
}

manifest["tarsum"] = tarsums
manifest["metadata"] = &metadata
manifest["history"] = history
manifest.BlobSums = tarsums
manifest.History = history

manifestBytes, err := json.MarshalIndent(manifest, "", " ")
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions registry/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ type RegistryInfo struct {
Standalone bool `json:"standalone"`
}

type ManifestData struct {
Name string `json:"name"`
Tag string `json:"tag"`
Architecture string `json:"architecture"`
BlobSums []string `json:"blobSums"`
History map[string]string `json:"history"`
}

type APIVersion int

func (av APIVersion) String() string {
Expand Down

0 comments on commit 3726654

Please sign in to comment.