Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-25946

Pushing OCI Artifact with custom config.mediaType fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: 4 - Normal
    • Resolution: Unresolved
    • Affects Version/s: 7.11.5
    • Fix Version/s: None
    • Component/s: Docker
    • Labels:
      None
    • Environment:

      Enterprise Plus 7.11.5 rev 71105900

    • Location:
      External

      Description

      Disclaimer

      Not entirely sure if bug or feature request. Since Artifactory 7.11, the container registry should be OCI compliant and tooling like ORAS is explicitly mentioned. Since latter is solely about OCI Artifacts, I have to assume that in general the corresponding OCI Artifact Specification should be supported.

      Problem

      Pushing an OCI Artifact to the OCI compliant container image registry with a custom config media type using e.g. ORAS

      cat << EOF > config.yaml 
      name: foo
      value: bar
      EOF
      
      cat << EOF > artifact.yaml 
      test: test
      EOF
      
      oras push <artifactory>/oci-artifact-experiment/test:latest --manifest-config config.yaml:application/prs.test.config.v1+yaml artifact.yaml:application/prm.test.layer.v1+yaml
      

      fails with the following error:

      2021-05-20T21:45:25.351Z [jfrt ] [INFO ] [16334dd1bd915a2f] [.h.DockerManifestPutHandler:89] [http-nio-8081-exec-8] - Deploying docker manifest for image 'test' and tag 'latest' in repo 'oci-artifact-experiment' 2021-05-20T21:45:25.355Z [jfrt ] [ERROR] [16334dd1bd915a2f] [ManifestSchema2Deserializer:46] [http-nio-8081-exec-8] - Unable to deserialize the manifest.json file: Unrecognized token 'name': was expecting 'null', 'true', 'false' or NaN at [Source: [B@4f7681a4; line: 1, column: 6] org.codehaus.jackson.JsonParseException: Unrecognized token 'name': was expecting 'null', 'true', 'false' or NaN
      

      When changing the manifest config file to json, the artifact gets uploaded correctly. It is noteworthy, that the media type for the manifest config object is not relevant and can be specified with any value. It seems the media type is not respected or validated at all.

      The layer types are not part of the problem, they are working as expected with custom media types and are accepted.

      The OCI Artifact specification allows custom media types for the manifest config object as well as for each layer (Link). But it seems, that Artifactory parses incoming OCI Artifacts config objects as json regardless of file format or specified media type.

      If OCI Artifacts should be supported (e.g. for Helm OCI Charts), not allowing custom media types for the manifest config prevents specifying compliant artifacts and limits implementer to the json type.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            Preu Matthias Preu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Sync Status

                Connection: RTFACT Sync
                RTMID-25947 -
                SYNCHRONIZED
                • Last Sync Date: