Skip to content

Commit 04f0dc7

Browse files
committed
Remove references to OCI-Content-Digest
Signed-off-by: Peter Engelbert <[email protected]>
1 parent ff2ab29 commit 04f0dc7

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

conformance/01_pull_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ var test01Pull = func() {
9797
resp, err := client.Do(req)
9898
Expect(err).To(BeNil())
9999
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
100+
if h := resp.Header().Get("Docker-Content-Digest"); h != "" {
101+
Expect(h).To(Equal(configBlobDigest))
102+
}
100103
})
101104

102105
g.Specify("GET nonexistent blob should result in 404 response", func() {
@@ -134,6 +137,9 @@ var test01Pull = func() {
134137
resp, err := client.Do(req)
135138
Expect(err).To(BeNil())
136139
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
140+
if h := resp.Header().Get("Docker-Content-Digest"); h != "" {
141+
Expect(h).To(Equal(manifestDigest))
142+
}
137143
})
138144

139145
g.Specify("HEAD request to manifest path (tag) should yield 200 response", func() {
@@ -144,6 +150,9 @@ var test01Pull = func() {
144150
resp, err := client.Do(req)
145151
Expect(err).To(BeNil())
146152
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
153+
if h := resp.Header().Get("Docker-Content-Digest"); h != "" {
154+
Expect(h).To(Equal(manifestDigest))
155+
}
147156
})
148157

149158
g.Specify("GET nonexistent manifest should return 404", func() {

spec.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,9 @@ The `<reference>` MUST NOT be in any other format. Throughout this document, `<n
137137
`[a-z0-9]+([._-][a-z0-9]+)*(/[a-z0-9]+([._-][a-z0-9]+)*)*`
138138

139139
A GET request to an existing manifest URL MUST provide the expected manifest, with a response code that MUST be `200 OK`.
140-
A successful response SHOULD contain the digest of the uploaded blob in the header `OCI-Content-Digest`. For legacy
141-
reasons, the digest MAY be contained in the header `Docker-Content-Digest` instead. Either header is OPTIONAL.
140+
A successful response SHOULD contain the digest of the uploaded blob in the header `Docker-Content-Digest`.
142141

143-
The `OCI-Content-Digest` header (or, as a fallback, `Docker-Content-Digest` header), if present on the response, returns the canonical
142+
The `Docker-Content-Digest` header, if present on the response, returns the canonical
144143
digest of the uploaded blob which MAY differ from the provided digest. If the digest does differ, it MAY be the case that
145144
the hashing algorithms used do not match. See [Content Digests](./detail.md) for information on how to detect the hashing
146145
algorithm in use. Most clients MAY ignore the value, but if it is used, the client MUST verify the value against the uploaded
@@ -156,23 +155,21 @@ To pull a blob, perform a `GET` request to a URL in the following form:
156155
`<name>` is the namespace of the repository, and `<digest>` is the blob's digest.
157156

158157
A GET request to an existing blob URL MUST provide the expected blob, with a response code that MUST be `200 OK`.
159-
A successful response SHOULD contain the digest of the uploaded blob in the header `OCI-Content-Digest`. For legacy
160-
reasons, the digest MAY be contained in the header `Docker-Content-Digest` instead. Either header is OPTIONAL. However,
161-
if one of these headers is present, the value of the header MUST be a digest matching that of the response body.
158+
A successful response SHOULD contain the digest of the uploaded blob in the header `Docker-Content-Digest`. If present,
159+
the value of this header MUST be a digest matching that of the response body.
162160

163161
If the blob is not found in the registry, the response code MUST be `404 Not Found`.
164162

165163
##### Checking if content exists in the registry
166164

167165
In order to verify that a repository contains a given manifest or blob, make a `HEAD` request to a URL in the following form:
168166

169-
`/v2/<name>/manifests/<reference>` <sup>[end-12](#endpoints)</sup> (for manifests), or
167+
`/v2/<name>/manifests/<reference>` <sup>[end-3](#endpoints)</sup> (for manifests), or
170168

171-
`/v2/<name>/blobs/<digest>` <sup>[end-11](#endpoints)</sup> (for blobs).
169+
`/v2/<name>/blobs/<digest>` <sup>[end-2](#endpoints)</sup> (for blobs).
172170

173171
A HEAD request to an existing blob or manifest URL MUST return `200 OK`. A successful response SHOULD contain the digest
174-
of the uploaded blob in the header `OCI-Content-Digest`. For legacy reasons, the digest MAY be contained in the header
175-
`Docker-Content-Digest` instead. Either header is OPTIONAL.
172+
of the uploaded blob in the header `Docker-Content-Digest`.
176173

177174
If the blob or manifest is not found in the registry, the response code MUST be `404 Not Found`.
178175

@@ -470,23 +467,21 @@ of this specification.
470467

471468
#### Endpoints
472469

473-
| ID | Method | API endpoint | Accepted Successful Response Codes | Accepted Failure Response Codes |
474-
| ------ | -------- | ----------------------------------------------------------------- | ---------------------------------- | ------------------------------- |
475-
| end-1 | `GET` | `/v2/` | `200` | `404`/`401` |
476-
| end-2 | `GET` | `/v2/<name>/blobs/<digest>` | `200` | `404` |
477-
| end-3 | `GET` | `/v2/<name>/manifests/<reference>` | `200` | `404` |
478-
| end-4a | `POST` | `/v2/<name>/blobs/uploads/` | `202` | `404` |
479-
| end-4b | `POST` | `/v2/<name>/blobs/uploads/?digest=<digest>` | `201`/`202` | `404`/`400` |
480-
| end-5 | `PATCH` | `/v2/<name>/blobs/uploads/<reference>` | `202` | `404`/`416` |
481-
| end-6 | `PUT` | `/v2/<name>/blobs/uploads/<reference>?digest=<digest>` | `201` | `404`/`400` |
482-
| end-7 | `PUT` | `/v2/<name>/manifests/<reference>` | `201` | `404` |
483-
| end-8a | `GET` | `/v2/<name>/tags/list` | `200` | `404` |
484-
| end-8b | `GET` | `/v2/<name>/tags/list?n=<integer>&last=<integer>` | `200` | `404` |
485-
| end-9 | `DELETE` | `/v2/<name>/manifests/<reference>` | `202` | `404`/`400`/`405` |
486-
| end-10 | `DELETE` | `/v2/<name>/blobs/<digest>` | `202` | `404`/`405` |
487-
| end-11 | `POST` | `/v2/<name>/blobs/uploads/?mount=<digest>&from=<other_namespace>` | `201` | `404` |
488-
| end-12 | `HEAD` | `/v2/<name>/blobs/<digest>` | `200` | `404` |
489-
| end-13 | `HEAD` | `/v2/<name>/manifests/<reference>` | `200` | `404` |
470+
| ID | Method | API endpoint | Accepted Successful Response Codes | Accepted Failure Response Codes |
471+
| ------ | -------------- | ----------------------------------------------------------------- | ---------------------------------- | ------------------------------- |
472+
| end-1 | `GET` | `/v2/` | `200` | `404`/`401` |
473+
| end-2 | `GET` / `HEAD` | `/v2/<name>/blobs/<digest>` | `200` | `404` |
474+
| end-3 | `GET` / `HEAD` | `/v2/<name>/manifests/<reference>` | `200` | `404` |
475+
| end-4a | `POST` | `/v2/<name>/blobs/uploads/` | `202` | `404` |
476+
| end-4b | `POST` | `/v2/<name>/blobs/uploads/?digest=<digest>` | `201`/`202` | `404`/`400` |
477+
| end-5 | `PATCH` | `/v2/<name>/blobs/uploads/<reference>` | `202` | `404`/`416` |
478+
| end-6 | `PUT` | `/v2/<name>/blobs/uploads/<reference>?digest=<digest>` | `201` | `404`/`400` |
479+
| end-7 | `PUT` | `/v2/<name>/manifests/<reference>` | `201` | `404` |
480+
| end-8a | `GET` | `/v2/<name>/tags/list` | `200` | `404` |
481+
| end-8b | `GET` | `/v2/<name>/tags/list?n=<integer>&last=<integer>` | `200` | `404` |
482+
| end-9 | `DELETE` | `/v2/<name>/manifests/<reference>` | `202` | `404`/`400`/`405` |
483+
| end-10 | `DELETE` | `/v2/<name>/blobs/<digest>` | `202` | `404`/`405` |
484+
| end-11 | `POST` | `/v2/<name>/blobs/uploads/?mount=<digest>&from=<other_namespace>` | `201` | `404` |
490485

491486
#### Error Codes
492487

0 commit comments

Comments
 (0)