Override media type returned from Stat for existing manifests.

Signed-off-by: Richard Scothern <richard.scothern@docker.com>
v2.5.0-rc.2
Richard Scothern 2016-06-29 14:52:50 -07:00
parent 96ae5c907b
commit 4614c39896
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,9 @@ func (mb *builder) Build(ctx context.Context) (distribution.Manifest, error) {
m.Config, err = mb.bs.Stat(ctx, configDigest)
switch err {
case nil:
// Override MediaType, since Put always replaces the specified media
// type with application/octet-stream in the descriptor it returns.
m.Config.MediaType = MediaTypeConfig
return FromStruct(m)
case distribution.ErrBlobUnknown:
// nop