Skip to content

Commit

Permalink
Require cross-mounting
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
  • Loading branch information
pmengelbert committed Oct 29, 2020
1 parent ff20463 commit 810b94f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
13 changes: 3 additions & 10 deletions conformance/02_push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,21 +206,14 @@ var test02Push = func() {
SetQueryParam("from", client.Config.DefaultName)
resp, err := client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(SatisfyAny(
Equal(http.StatusCreated),
Equal(http.StatusMethodNotAllowed),
))
Expect(resp.StatusCode()).To(Equal(http.StatusCreated))
Expect(resp.GetRelativeLocation()).To(ContainSubstring(crossmountNamespace))

lastResponse = nil
if resp.StatusCode() == http.StatusCreated {
lastResponse = resp
Expect(lastResponse.GetRelativeLocation()).ToNot(BeEmpty())
}
lastResponse = resp
})

g.Specify("GET request to test digest within cross-mount namespace should return 200", func() {
SkipIfDisabled(push)
RunOnlyIfNot(lastResponse == nil)

req := client.NewRequest(reggie.GET, lastResponse.GetRelativeLocation())
resp, err := client.Do(req)
Expand Down
4 changes: 2 additions & 2 deletions conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ environment:
OCI_SKIP_EMPTY_LAYER_PUSH_TEST=1
```

Some registries allow cross-repository blob mounting. As such, the test suite will need access to a second namespace.
This namespace may need to be configured on the server-side in advance, and it is specified by setting the following in
The test suite will need access to a second namespace. This namespace is used to check support for cross-repository mounting
of blobs, and may need to be configured on the server-side in advance. It is specified by setting the following in
the environment:

```
Expand Down
4 changes: 3 additions & 1 deletion spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ Location: <blob-location>
The digest contained in the `Location` header MAY be different from that of the blob that was mounted. As such, a client
SHOULD use the digest found in the path from this header and SHOULD NOT use the digest of the blob that was mounted.

If the source blob is not found, the response MUST be `404 Not Found`.

##### Pushing Manifests

To push a manifest, perform a `PUT` request to a path in the following format, and with the following headers
Expand Down Expand Up @@ -445,7 +447,7 @@ of this specification.
| end-8b | `GET` | `/v2/<name>/tags/list?n=<integer>&last=<integer>` | `200` | `404` |
| end-9 | `DELETE` | `/v2/<name>/manifests/<reference>` | `202` | `404`/`400`/`405` |
| end-10 | `DELETE` | `/v2/<name>/blobs/<digest>` | `202` | `404`/`405` |
| end-11 | `POST` | `/v2/<name>/blobs/uploads/?mount=<digest>&from=<other_namespace>` | `201` | `405` |
| end-11 | `POST` | `/v2/<name>/blobs/uploads/?mount=<digest>&from=<other_namespace>` | `201` | `404` |

#### Error Codes

Expand Down

0 comments on commit 810b94f

Please sign in to comment.