Skip to content

No way to programmatically detect “schema1 manifests are disabled” #2925

@mtrmac

Description

@mtrmac

After #2474 , pushes of schema1 manifests are disabled by default.

Unfortunately, because distribution.ErrSchemaV1Unsupported is not registered in github.com/docker/distribution/registry/api/errcode, trying to push such a manifest results in generic:

HTTP/1.1 500 Internal Server Error
Connection: close
…

{"errors":[{"code":"UNKNOWN","message":"unknown error","detail":{}}]}

which does not allow automatically differentiating the “schema1 manifests are disabled” situation from other internal failures.

Please define a new error code specific to “the manifest MIME type or contents are not recognized, or recognized and rejected”, and use it here; or reuse one of the previously used values in this case:

  • ErrorCodeManifestInvalid, returned by OpenShift for schema2 when configured with acceptschema2=false
  • ErrorCodeTagInvalid, returned by docker/distribution (as of commit ec87e9b) when uploading to a tag (IIRC because it tries to parse a schema2 manifest as schema1, and it can’t find a tag matching the HTTP request path inside the manifest)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions