forked from TrueCloudLab/distribution
Merge pull request #1622 from aaronlehmann/schema2-config-mediatype
Use correct media type for config blob in schema2 manifest
This commit is contained in:
commit
467fc068d8
2 changed files with 4 additions and 1 deletions
|
@ -55,6 +55,9 @@ func (mb *builder) Build(ctx context.Context) (distribution.Manifest, error) {
|
||||||
|
|
||||||
// Add config to the blob store
|
// Add config to the blob store
|
||||||
m.Config, err = mb.bs.Put(ctx, MediaTypeConfig, mb.configJSON)
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ func (bs *mockBlobService) Put(ctx context.Context, mediaType string, p []byte)
|
||||||
d := distribution.Descriptor{
|
d := distribution.Descriptor{
|
||||||
Digest: digest.FromBytes(p),
|
Digest: digest.FromBytes(p),
|
||||||
Size: int64(len(p)),
|
Size: int64(len(p)),
|
||||||
MediaType: mediaType,
|
MediaType: "application/octet-stream",
|
||||||
}
|
}
|
||||||
bs.descriptors[d.Digest] = d
|
bs.descriptors[d.Digest] = d
|
||||||
return d, nil
|
return d, nil
|
||||||
|
|
Loading…
Reference in a new issue