oras-project / rust-oci-client

A Rust crate to interact with OCI registries
Apache License 2.0
86 stars 45 forks source link

Retrieving "unmangled" manifests for digest consistency? #114

Closed MathiasPius closed 5 months ago

MathiasPius commented 5 months ago

Is there a way to fetch raw manifests without deserializing them immediately?

When retrieving manifests, they're automatically deserialized into Rust structures which is very handy, but unfortunately this also means that if you intend to push the manifest elsewhere your re-serialized version of the content might not match the digest provided by the upstream.

This problem can be worked around by simply not providing an expected digest when pushing to containerd for example, but this feels like a bit of a hack, since the changes to the underlying manifest (if any) are purely cosmetic, and the content and digest are in fact inconsistent. Removing the expected digest simply allows the push to go through, but the final object will still have a different digest.

thomastaylor312 commented 5 months ago

I don't think there is a way to do this now, but this would be a great feature to add. I'll label accordingly

thomastaylor312 commented 5 months ago

To be clear, we have a push_manifest_raw and we should just have a pull_manifest_raw