Allow empty layer configs in manifests

Before the V2 registry changes, images with no config could be pushed.
This change fixes a regression that made those images not able to be
pushed to a registry.

Signed-off-by: Euan Kemp <euank@euank.com>
Upstream-commit: d477d42dd3e6a98f82c6ed2abb1dfeeb2782539f
Component: engine
This commit is contained in:
Euan
2015-01-24 14:27:37 -08:00
committed by euank
parent d9de984b24
commit 3bf93236d1
2 changed files with 39 additions and 5 deletions
+3 -5
View File
@@ -3,7 +3,6 @@ package graph
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
@@ -71,14 +70,13 @@ func (s *TagStore) newManifest(localName, remoteName, tag string) ([]byte, error
if err != nil {
return nil, err
}
if layer.Config == nil {
return nil, errors.New("Missing layer configuration")
}
manifest.Architecture = layer.Architecture
manifest.FSLayers = make([]*registry.FSLayer, 0, 4)
manifest.History = make([]*registry.ManifestHistory, 0, 4)
var metadata runconfig.Config
metadata = *layer.Config
if layer.Config != nil {
metadata = *layer.Config
}
for ; layer != nil; layer, err = layer.GetParent() {
if err != nil {