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

clarify push manifest spec #333

Merged

Conversation

laflechejonathan
Copy link

See discussion at: moby/buildkit#2963

It's not currently obvious from reading the spec that manifests should be persisted in the exact wire format provided by the client, leading to errors if a registry re-formats the manifest.

This code in containerd validates the Docker-Content-Digest header after a manifest push, and will throw if they don't match:

https://github.com/moby/buildkit/blob/874eef9b70dbaf4f074d2bc8f4dc64237f8e83a0/vendor/github.com/containerd/containerd/remotes/docker/pusher.go#L418-L425

jdolitsky
jdolitsky previously approved these changes Jul 15, 2022
Copy link
Member

@jdolitsky jdolitsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laflechejonathan - could you please fix the DCO issue?

Signed-off-by: jlafleche <[email protected]>
@laflechejonathan
Copy link
Author

@jdolitsky are we good to merge this?

@jdolitsky jdolitsky merged commit e8ab48c into opencontainers:main Aug 9, 2022
@@ -423,13 +423,17 @@ Manifest byte stream:

The uploaded manifest MUST reference any blobs that make up the artifact.
However, the list of blobs MAY be empty.

The registry MUST store the manifest in the exact byte representation provided by the client.
Copy link
Member

@mikebrow mikebrow Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might've worded "in the exact byte representation" more like "byte for byte exactly as"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this one is merged, any wording changes now should be pushed as a new PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)

Upon a successful upload, the registry MUST return response code `201 Created`, and MUST have the following header:

```
Location: <location>
```

The `<location>` is a pullable manifest URL.
The Docker-Content-Digest header returns the canonical digest of the uploaded blob, and MUST be equal to the client provided digest.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest rewording this to fit the paragraph..

what if the digest differ? What if the client did not provide one..

Upon a successful upload, the registry MUST return response code `201 Created`, and MUST have the following header:

```
Location: <location>
```

The `<location>` is a pullable manifest URL.
The Docker-Content-Digest header returns the canonical digest of the uploaded blob, and MUST be equal to the client provided digest.
Clients MAY ignore the value but if it is used, the client SHOULD verify the value against the uploaded blob data.
Copy link
Member

@mikebrow mikebrow Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manifest? what value? probably needs to be reworded?

@jdolitsky jdolitsky mentioned this pull request Sep 15, 2022
@sudo-bmitch sudo-bmitch mentioned this pull request Feb 1, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants