From beb5d0047439779e56eb991fd9655c8ac3659b43 Mon Sep 17 00:00:00 2001 From: Richard Scothern Date: Wed, 29 Jun 2016 14:52:50 -0700 Subject: [PATCH] Override media type returned from Stat for existing manifests. Signed-off-by: Richard Scothern --- manifest/schema2/builder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifest/schema2/builder.go b/manifest/schema2/builder.go index 44b94eaa..ec0bf858 100644 --- a/manifest/schema2/builder.go +++ b/manifest/schema2/builder.go @@ -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