mirror of
https://github.com/docker/cli.git
synced 2026-09-27 01:40:31 -04:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user