Merge pull request #1622 from aaronlehmann/schema2-config-mediatype

Use correct media type for config blob in schema2 manifest
pull/1625/head
Richard Scothern 2016-04-11 17:23:03 -07:00
commit 467fc068d8
2 changed files with 4 additions and 1 deletions

View File

@ -55,6 +55,9 @@ func (mb *builder) Build(ctx context.Context) (distribution.Manifest, error) {
// Add config to the blob store
m.Config, err = mb.bs.Put(ctx, MediaTypeConfig, mb.configJSON)
// Override MediaType, since Put always replaces the specified media
// type with application/octet-stream in the descriptor it returns.
m.Config.MediaType = MediaTypeConfig
if err != nil {
return nil, err
}

View File

@ -32,7 +32,7 @@ func (bs *mockBlobService) Put(ctx context.Context, mediaType string, p []byte)
d := distribution.Descriptor{
Digest: digest.FromBytes(p),
Size: int64(len(p)),
MediaType: mediaType,
MediaType: "application/octet-stream",
}
bs.descriptors[d.Digest] = d
return d, nil