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

OCI: POST request with digest and blob should yield 201 #3212

Closed
wants to merge 3 commits into from
Closed

OCI: POST request with digest and blob should yield 201 #3212

wants to merge 3 commits into from

Conversation

waynr
Copy link
Contributor

@waynr waynr commented Aug 3, 2020

fixes #3230 OCI Conformance: POST request with digest and blob should yield a 201

This addresses a couple compliance failures mentioned in #3203 by adding a new function, PostBlobData, that dispatches to different handler functions depending on the contents of the digest query parameter and whether or not the POST request has a non-zero content length.

@thaJeztah
Copy link
Member

Is it guaranteed that processing is complete (irregardless of the storage backend?) I have a feeling that both 202 and 201 can be valid responses.

@dmcgowan @manishtomar PTAL

@waynr
Copy link
Contributor Author

waynr commented Aug 4, 2020

@thaJeztah the spec says:

Initiate a resumable blob upload. If successful, an upload location will be provided to complete the upload. Optionally, if the digest parameter is present, the request body will be used to complete the upload in a single request.

and

Upload a blob identified by the digest parameter in single request. This upload will not be resumable unless a recoverable error is returned.

Although now that I take another look at the spec, I'm not quite sure how I came up with the requirement in code that Content-Length be greater than zero.

Signed-off-by: Wayne Warren <wayne.warren.s@gmail.com>
Signed-off-by: Wayne Warren <wayne.warren.s@gmail.com>
Signed-off-by: Wayne Warren <wayne.warren.s@gmail.com>
@pmengelbert pmengelbert mentioned this pull request Aug 26, 2020
12 tasks
Base automatically changed from master to main January 27, 2021 15:51
@wy65701436
Copy link
Collaborator

as the spec was changed per opencontainers/distribution-spec#206, this pull-request is not valid.

@thaJeztah
Copy link
Member

Good catch; looks like this is the updated description (if I'm reading the correct section);

The response to a successful mount MUST be 201 Created, and MUST contain the following header:
...
Alternatively, if a registry does not support cross-repository mounting or is unable to mount the requested blob,
it SHOULD return a 202. This indicates that the upload session has begun and that the client MAY proceed with the upload.

@milosgajdos milosgajdos added the conformance Related to conformance to distribution specification label Apr 23, 2021
@milosgajdos
Copy link
Member

as the spec was changed per opencontainers/distribution-spec#206, this pull-request is not valid.

Should we close this PR or do you want to give it a rework @waynr ?

@thaJeztah
Copy link
Member

Looks like we can close this one indeed (also see #3230 (comment))

Thanks @waynr !

@thaJeztah thaJeztah closed this Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conformance Related to conformance to distribution specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OCI Conformance: POST request with digest and blob should yield a 201
4 participants