camallo / dkregistry-rs

A pure-Rust asynchronous library for Docker Registry API v2
Apache License 2.0
62 stars 39 forks source link

v2/manifest: document layers order #47

Closed lucab closed 6 years ago

lucab commented 6 years ago

This documents the order used by this crate when listing layers' digests.

lucab commented 6 years ago

/cc @steveeJ

lucab commented 6 years ago

@steveeJ the order is pretty much arbitrary, and docker switched it between two revisions, so I just picked the most recent one. I think their rationale is that you have to start rendering the base one first anyway. I would not introduce another flag as the consumer can simply .rev() if it needs, but we can switch the current order if you think it suits better.

steveej commented 6 years ago

he order is pretty much arbitrary, and docker switched it between two revisions, so I just picked the most recent one

If that's true we could detect the order and ensure we always hand it out in the same order. I don't have a strong opinion on what the order is, but I insist on it being predictable.

lucab commented 6 years ago

@steveeJ yes, it's fixed to follow the v2s2 one (base layer first). For the old schema the inversion is done internally, here: https://github.com/camallo/dkregistry-rs/blob/2cd5f12ef1beb93006858bed06d07ea755f868f3/src/v2/manifest/manifest_schema1.rs#L43

steveej commented 6 years ago

yes, it's fixed to follow the v2s2 one (base layer first). For the old schema the inversion is done internally, here:

/lgtm