aws / containers-roadmap

This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
https://aws.amazon.com/about-aws/whats-new/containers/
Other
5.21k stars 318 forks source link

[ECR] [request]: Loosen restrictions on accepted media types #2306

Open bdehamer opened 7 months ago

bdehamer commented 7 months ago

Community Note

Tell us about your request I'd like for ECR to be less strict about the media type value which are accepted in the artifactType and layer mediaType fields in the image manifest.

Which service(s) is this request for? ECR

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? I'm trying to push the following manifest into ECR:

{
  "annotations": {
    "org.opencontainers.image.created": "2024-03-08T19:12:54Z"
  },
  "artifactType": "application/vnd.dev.sigstore.bundle+json;version=0.2",
  "config": {
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "mediaType": "application/vnd.oci.empty.v1+json",
    "size": 2
  },
  "layers": [
    {
      "annotations": {
        "org.opencontainers.image.title": "att.json"
      },
      "digest": "sha256:d1c3842b99b57095dccfb71e590003e2a66c701a8eff20ffd7cba1ae07e3fd3d",
      "mediaType": "application/vnd.dev.sigstore.bundle+json;version=0.2",
      "size": 5752
    }
  ],
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "schemaVersion": 2,
  "subject": {
    "digest": "sha256:221189b511bd1b01a233c9af11467cddb722347a2bef2162385b34034f78d212",
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "size": 855
  }
}

The response I get is:

405 Method Not Allowed

{"errors":[{"code":"UNSUPPORTED","message":"Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'"}]}

The issue appears to be the ;version=0.2 portion of my media type -- if I remove that parameter, the manifest can be uploaded successfully.

Are you currently working around this issue? The only work-around I have at the moment is to re-write my media type strings and remove the version parameter, but this is critical data I'd rather not lose.

Additional context The OCI image spec has the following to say about the artifactType field:

If defined, the value MUST comply with RFC 6838, including the naming requirements in its section 4.2...

RFC 6838 includes support for media type parameters (~section 4.4~section 4.3) so it would seem that my media type is compliant with the spec.

Related: https://github.com/aws/containers-roadmap/issues/308

kattmang commented 7 months ago

Hey @bdehamer , I believe the section relevant to the break here is actually 4.3 in the RFC spec: https://datatracker.ietf.org/doc/html/rfc6838#section-4.3

I've confirmed internally this is likely a bug on our side, and we'll let you know when we've rolled out a fix.

yanivpaz commented 3 months ago

Hi @kattmang is there ETA for this fix?