oras-project / rust-oci-client

A Rust crate to interact with OCI registries
Apache License 2.0
90 stars 47 forks source link

feat: Add OCI Image Configuration structures #57

Closed Xynnn007 closed 1 year ago

Xynnn007 commented 1 year ago

Related to https://github.com/krustlet/oci-distribution/issues/50, added structure definitions.

Xynnn007 commented 1 year ago

How do you intend for this to be consumed? Does the user use the config type if they want it and then have to serialize it to Vec<u8>? Or is there another way to make it easier? Just want to make sure I understand!

I've added a new API oci_v1_from_config_file to construct a Config using a ConfigFile. Typical scenarios:

To me the first scenario is needed, because current impl uses an empty config, which may be detected as illegal image for some registries. Thus, I want to provide some detailed support for OCI Configuration and let users use it arbitrarily.

For some configurations inside a registry may seem different from what the spec defines, I did not integrate deserialization of config into fn pull and leave it to users to use by their own and to their needs.