opencontainers / distribution-spec

OCI Distribution Specification
https://opencontainers.org
Apache License 2.0
780 stars 201 forks source link

Question regarding conformance tests for push #506

Open ViddeM opened 5 months ago

ViddeM commented 5 months ago

Hello!

I'm not sure if I'm just confused but it seems to me that the conformance test for push doesn't quite match the specification. The only PATCH endpoint in the spec (as far as I understand) is for the chunked upload flow (end-5) which seems to require the three headers Content-Type, Content-Range and Content-Length. However, in the conformance test for Blob upload streamed (link) there is a patch request that only provides the Content-Type header.

Am I confused or is this flow not covered by the specification and if so, why is it in the conformance tests?

sudo-bmitch commented 5 months ago

Good question. That entry in the conformance test goes way back (looks like it's at least 4 years old) so I can't speak to how it was added. However, it mirrors how docker pushes blobs, so I think the preference is to define the API in the spec rather than remove the conformance test. Issue #303 talks about that and I think it would be good to work on after we finish our 1.1 release.

ViddeM commented 5 months ago

Yeah I sorta started to assume that after doing some more digging, I found that Microsofts container registry API documentation seems to cover that flow in (enough) detail to implement something that passes the conformance tests.

https://learn.microsoft.com/en-us/rest/api/containerregistry/blob/upload https://learn.microsoft.com/en-us/rest/api/containerregistry/blob/start-upload https://learn.microsoft.com/en-us/rest/api/containerregistry/blob/end-upload