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
As of 0.1.25 it doesn't appear to me this supports Image Indexes.
The lift looks small - maybe as little as adding a media type to defaults.py, a schemas.py definition, and minor work to support it in the Registry object
Sample code might be
classRegistry(oras.provider.Registry):
""" Oras registry with support for image indexes. """@decorator.ensure_containerdefget_image_index(self, container, allowed_media_type=None):
""" Get an image index as a manifest. This is basically Registry.get_manifest with the following changes - different default allowed_media_type - no JSON schema validation """ifnotallowed_media_type:
default_image_index_media_type="application/vnd.oci.image.index.v1+json"# TODO: need this in defaults.pyallowed_media_type= [default_image_index_media_type]
headers= {"Accept": ";".join(allowed_media_type)}
manifest_url=f"{self.prefix}://{container.manifest_url()}"response=self.do_request(manifest_url, "GET", headers=headers)
self._check_200_response(response)
manifest=response.json()
# TODO: jsonschema.validate(manifest, schema=...)returnmanifest
If there's interest please let me know and I can put in a PR. In that case I ask if a new method like get_image_index is desired or if something else would be preferred.
In any case, thank you for the project!
The text was updated successfully, but these errors were encountered:
My use case is downloading an image index, selecting a platform-compatible manifest, and then following that to ultimately download a platform-specific artifact.
As of 0.1.25 it doesn't appear to me this supports Image Indexes.
The lift looks small - maybe as little as adding a media type to defaults.py, a schemas.py definition, and minor work to support it in the Registry object
Sample code might be
If there's interest please let me know and I can put in a PR. In that case I ask if a new method like
get_image_index
is desired or if something else would be preferred.In any case, thank you for the project!
The text was updated successfully, but these errors were encountered: