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

[Issue] OCI data types used in regctl are not the same with those from spec. #593

Closed
eusebiu-constantin-petu-dbk opened this issue Nov 10, 2023 · 1 comment · Fixed by #594
Assignees
Labels
bug Something isn't working

Comments

@eusebiu-constantin-petu-dbk
Copy link

eusebiu-constantin-petu-dbk commented Nov 10, 2023

Current Behavior

Currently in the spec https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/descriptor.go#L27 the order of keys is Mediatype, Digest, Size and so on.

In regctl the order is Mediatype, Size, Digest https://github.com/regclient/regclient/blob/main/types/descriptor.go#L25

Is this intended?

I want to use regctl as a library, but because of this issue, oci images pushed with regctl have different digests than the ones pushed with other clients that imports the types from spec.

Expected Behavior

Expected regctl oci data types to be the same as those from spec.

@sudo-bmitch
Copy link
Contributor

The order was probably pulled in from distribution/distribution that adjusted their values to align with the spec a while back: distribution/distribution#3810

Note that reproducibility of generated images between different tools, or even different versions of the same tool, isn't guaranteed. You'd need some kind of canonical JSON output, in addition to reproducible compression of image layers.

FYI, regclient maintains its own types separate from the spec to be a leading implementation, adding features to prove them out, before the spec adopts them. I'll have the fix merged shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants