Skip to content

Moby broken by data valdiation in unmarshaller #3024

@cpuguy83

Description

@cpuguy83

Moby has some registration code to handle OCI manfiests here: https://github.com/moby/moby/blob/6f069f14e6a76f2a3cdf50a089e67429581d7cc8/distribution/oci.go#L15-L28

Notice that it is using schema2.DeserializedManifest.

This commit 1d47ef7 which performs validation of the media type field on unmarshal is breaking that logic.

We can come up with a means of updating Moby... however this code looks wrong to me.

  1. Strictly as someone who doesn't spend much time on this codebase it seems like a bit of a smell to do data validation while converting formats (json bytes to go struct).
  2. It also seems incorrect to assume that the value of the field is always a particular value this deep in the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions