You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When discovering referrers of an image, harbor does not accurately report the size of referring manifests in the descriptors it returns. Instead of returning the size of the manifest it appears to return a size equal to the sum of the manifest and all successors, i.e. sum of manifest, config, and layers.
The returned descriptors should have a size equal to the referring manifest, not the sum of the manifest and successors. In the example above one would expect a size of 1433.
Result of Bug
The inaccurate descriptor results in "mismatch Content-Length" errors from more strict tools such as the Oras CLI or oras-go.
Steps to Reproduce
Push an image to a harbor registry
$ oras push OCI_REF PATH_TO_ARBITRARY_FILE
Sign the image with the notation cli
$ notation cert generate-test example
$ notation sign OCI_REF --key example
Copy the image to another repository in harbor, to another registry, or locally
$ oras copy OCI_REF DEST_OCI_REF -rError: GET OCI_REF/manifests/REFERRER_DIGEST: mismatch Content-Length
harbor version: [2.10.0]
The text was updated successfully, but these errors were encountered:
Expected Behavior and Actual Behavior:
When discovering referrers of an image, harbor does not accurately report the size of referring manifests in the descriptors it returns. Instead of returning the size of the manifest it appears to return a size equal to the sum of the manifest and all successors, i.e. sum of manifest, config, and layers.
See OCI distribution spec listing referrers
Actual Behavior
Request: GET /v2/project/repo/image/referrers/sha256:1880b485da1f81cf70b18b836e2c49544e83f4305dedfafbe71d25fbd1a63c51
Response: HTTP/2.0 200 OK\r\nContent-Length: 297
Looking at a descriptor in the returned index manifest:
The size in this returned descriptor appears to be the sum of the referring manifest itself as well as its successors:
Referring Manifest: 1433
Config: 2 (empty config)
Layer: 1263 (single layer)
Total: 2621
Expected Behavior
The returned descriptors should have a size equal to the referring manifest, not the sum of the manifest and successors. In the example above one would expect a size of 1433.
Result of Bug
The inaccurate descriptor results in "mismatch Content-Length" errors from more strict tools such as the Oras CLI or oras-go.
Steps to Reproduce
$ oras push OCI_REF PATH_TO_ARBITRARY_FILE
The text was updated successfully, but these errors were encountered: