Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add OCI Image Configuration structures #57

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

Xynnn007
Copy link
Contributor

Related to #50, added structure definitions.

Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small changes requested here.

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!

src/config.rs Outdated Show resolved Hide resolved
src/config.rs Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
- Added OCI Image Configuration structure named `ConfigFile`
- Added an API to create a `Config` struct from
`ConfigFile`

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
@Xynnn007
Copy link
Contributor Author

Xynnn007 commented Dec 16, 2022

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:

  • A user wants to push a cosign signature and create a related structured Config
  • A user wants to pull an image using pull() to get ImageData, and then he can parse the image_data.config.data into a structure to do some other things.

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.

Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all the effort with this! Everything is looking good

@thomastaylor312 thomastaylor312 merged commit 865faeb into oras-project:main Dec 16, 2022
@Xynnn007 Xynnn007 deleted the feat-config branch December 17, 2022 05:13
thomastaylor312 added a commit that referenced this pull request Mar 2, 2023
feat: Add OCI Image Configuration structures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants