Skip to content

Commit 582c04a

Browse files
committed
Merge branch 'main' of github.com:opencontainers/distribution-spec into 201-202-debacle
Signed-off-by: Josh Dolitsky <[email protected]>
2 parents 1659f70 + 7d52c1b commit 582c04a

File tree

9 files changed

+122
-92
lines changed

9 files changed

+122
-92
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: release
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
tags:
88
- v*
99

.pullapprove.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ group_defaults:
2020
ignored: true
2121
conditions:
2222
branches:
23-
- master
23+
- main
2424

2525
groups:
2626
distribution-spec:

MAINTAINERS_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ All decisions affecting this project, big and small, follow the same procedure:
5757

5858
### I'm a maintainer, should I make pull requests too?
5959

60-
Yes. Nobody should ever push to master directly. All changes should be
60+
Yes. Nobody should ever push to main directly. All changes should be
6161
made through a pull request.
6262

6363
## Who decides what?

conformance/01_pull_test.go

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package conformance
22

33
import (
4-
"fmt"
54
"net/http"
65
"os"
76

@@ -22,10 +21,10 @@ var test01Pull = func() {
2221
req := client.NewRequest(reggie.POST, "/v2/<name>/blobs/uploads/")
2322
resp, _ := client.Do(req)
2423
req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()).
25-
SetQueryParam("digest", configBlobDigest).
24+
SetQueryParam("digest", configs[0].Digest).
2625
SetHeader("Content-Type", "application/octet-stream").
27-
SetHeader("Content-Length", fmt.Sprintf("%d", len(configBlobContent))).
28-
SetBody(configBlobContent)
26+
SetHeader("Content-Length", configs[0].ContentLength).
27+
SetBody(configs[0].Content)
2928
resp, err := client.Do(req)
3029
Expect(err).To(BeNil())
3130
Expect(resp.StatusCode()).To(SatisfyAll(
@@ -57,7 +56,7 @@ var test01Pull = func() {
5756
req := client.NewRequest(reggie.PUT, "/v2/<name>/manifests/<reference>",
5857
reggie.WithReference(tag)).
5958
SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json").
60-
SetBody(manifestContent)
59+
SetBody(manifests[0].Content)
6160
resp, err := client.Do(req)
6261
Expect(err).To(BeNil())
6362
Expect(resp.StatusCode()).To(SatisfyAll(
@@ -71,6 +70,13 @@ var test01Pull = func() {
7170
req := client.NewRequest(reggie.GET, "/v2/<name>/tags/list")
7271
resp, _ := client.Do(req)
7372
tag = getTagNameFromResponse(resp)
73+
74+
// attempt to forcibly overwrite this tag with the unique manifest for this run
75+
req = client.NewRequest(reggie.PUT, "/v2/<name>/manifests/<reference>",
76+
reggie.WithReference(tag)).
77+
SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json").
78+
SetBody(manifests[0].Content)
79+
_, _ = client.Do(req)
7480
})
7581

7682
g.Specify("Get tag name from environment", func() {
@@ -93,12 +99,12 @@ var test01Pull = func() {
9399
g.Specify("HEAD request to existing blob should yield 200", func() {
94100
SkipIfDisabled(pull)
95101
req := client.NewRequest(reggie.HEAD, "/v2/<name>/blobs/<digest>",
96-
reggie.WithDigest(configBlobDigest))
102+
reggie.WithDigest(configs[0].Digest))
97103
resp, err := client.Do(req)
98104
Expect(err).To(BeNil())
99105
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
100106
if h := resp.Header().Get("Docker-Content-Digest"); h != "" {
101-
Expect(h).To(Equal(configBlobDigest))
107+
Expect(h).To(Equal(configs[0].Digest))
102108
}
103109
})
104110

@@ -113,7 +119,7 @@ var test01Pull = func() {
113119

114120
g.Specify("GET request to existing blob URL should yield 200", func() {
115121
SkipIfDisabled(pull)
116-
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
122+
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[0].Digest))
117123
resp, err := client.Do(req)
118124
Expect(err).To(BeNil())
119125
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
@@ -132,13 +138,13 @@ var test01Pull = func() {
132138

133139
g.Specify("HEAD request to manifest path (digest) should yield 200 response", func() {
134140
SkipIfDisabled(pull)
135-
req := client.NewRequest(reggie.HEAD, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest)).
141+
req := client.NewRequest(reggie.HEAD, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[0].Digest)).
136142
SetHeader("Accept", "application/vnd.oci.image.manifest.v1+json")
137143
resp, err := client.Do(req)
138144
Expect(err).To(BeNil())
139145
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
140146
if h := resp.Header().Get("Docker-Content-Digest"); h != "" {
141-
Expect(h).To(Equal(manifestDigest))
147+
Expect(h).To(Equal(manifests[0].Digest))
142148
}
143149
})
144150

@@ -151,7 +157,7 @@ var test01Pull = func() {
151157
Expect(err).To(BeNil())
152158
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
153159
if h := resp.Header().Get("Docker-Content-Digest"); h != "" {
154-
Expect(h).To(Equal(manifestDigest))
160+
Expect(h).To(Equal(manifests[0].Digest))
155161
}
156162
})
157163

@@ -166,7 +172,7 @@ var test01Pull = func() {
166172

167173
g.Specify("GET request to manifest path (digest) should yield 200 response", func() {
168174
SkipIfDisabled(pull)
169-
req := client.NewRequest(reggie.GET, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest)).
175+
req := client.NewRequest(reggie.GET, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[0].Digest)).
170176
SetHeader("Accept", "application/vnd.oci.image.manifest.v1+json")
171177
resp, err := client.Do(req)
172178
Expect(err).To(BeNil())
@@ -211,7 +217,7 @@ var test01Pull = func() {
211217
g.Specify("Delete manifest created in setup", func() {
212218
SkipIfDisabled(pull)
213219
RunOnlyIf(runPullSetup)
214-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest))
220+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[0].Digest))
215221
resp, err := client.Do(req)
216222
Expect(err).To(BeNil())
217223
Expect(resp.StatusCode()).To(SatisfyAny(
@@ -227,7 +233,7 @@ var test01Pull = func() {
227233
g.Specify("Delete config blob created in setup", func() {
228234
SkipIfDisabled(pull)
229235
RunOnlyIf(runPullSetup)
230-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
236+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[0].Digest))
231237
resp, err := client.Do(req)
232238
Expect(err).To(BeNil())
233239
Expect(resp.StatusCode()).To(SatisfyAny(
@@ -258,7 +264,7 @@ var test01Pull = func() {
258264
g.Specify("Delete manifest created in setup", func() {
259265
SkipIfDisabled(pull)
260266
RunOnlyIf(runPullSetup)
261-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest))
267+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[0].Digest))
262268
resp, err := client.Do(req)
263269
Expect(err).To(BeNil())
264270
Expect(resp.StatusCode()).To(SatisfyAny(

conformance/02_push_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ var test02Push = func() {
6363
g.Specify("POST request with digest and blob should yield a 201 or 202", func() {
6464
SkipIfDisabled(push)
6565
req := client.NewRequest(reggie.POST, "/v2/<name>/blobs/uploads/").
66-
SetHeader("Content-Length", configBlobContentLength).
66+
SetHeader("Content-Length", configs[1].ContentLength).
6767
SetHeader("Content-Type", "application/octet-stream").
68-
SetQueryParam("digest", configBlobDigest).
69-
SetBody(configBlobContent)
68+
SetQueryParam("digest", configs[1].Digest).
69+
SetBody(configs[1].Content)
7070
resp, err := client.Do(req)
7171
Expect(err).To(BeNil())
7272
location := resp.Header().Get("Location")
@@ -80,7 +80,7 @@ var test02Push = func() {
8080

8181
g.Specify("GET request to blob URL from prior request should yield 200 or 404 based on response code", func() {
8282
SkipIfDisabled(push)
83-
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
83+
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[1].Digest))
8484
resp, err := client.Do(req)
8585
Expect(err).To(BeNil())
8686
if lastResponse.StatusCode() == http.StatusAccepted {
@@ -102,10 +102,10 @@ var test02Push = func() {
102102
g.Specify("PUT upload of a blob should yield a 201 Response", func() {
103103
SkipIfDisabled(push)
104104
req := client.NewRequest(reggie.PUT, lastResponse.GetRelativeLocation()).
105-
SetHeader("Content-Length", configBlobContentLength).
105+
SetHeader("Content-Length", configs[1].ContentLength).
106106
SetHeader("Content-Type", "application/octet-stream").
107-
SetQueryParam("digest", configBlobDigest).
108-
SetBody(configBlobContent)
107+
SetQueryParam("digest", configs[1].Digest).
108+
SetBody(configs[1].Content)
109109
resp, err := client.Do(req)
110110
Expect(err).To(BeNil())
111111
location := resp.Header().Get("Location")
@@ -115,7 +115,7 @@ var test02Push = func() {
115115

116116
g.Specify("GET request to existing blob should yield 200 response", func() {
117117
SkipIfDisabled(push)
118-
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
118+
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[1].Digest))
119119
resp, err := client.Do(req)
120120
Expect(err).To(BeNil())
121121
Expect(resp.StatusCode()).To(Equal(http.StatusOK))
@@ -257,7 +257,7 @@ var test02Push = func() {
257257
req := client.NewRequest(reggie.PUT, "/v2/<name>/manifests/<reference>",
258258
reggie.WithReference(tag)).
259259
SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json").
260-
SetBody(manifestContent)
260+
SetBody(manifests[1].Content)
261261
resp, err := client.Do(req)
262262
Expect(err).To(BeNil())
263263
location := resp.Header().Get("Location")
@@ -282,7 +282,7 @@ var test02Push = func() {
282282

283283
g.Specify("GET request to manifest URL (digest) should yield 200 response", func() {
284284
SkipIfDisabled(push)
285-
req := client.NewRequest(reggie.GET, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest)).
285+
req := client.NewRequest(reggie.GET, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[1].Digest)).
286286
SetHeader("Accept", "application/vnd.oci.image.manifest.v1+json")
287287
resp, err := client.Do(req)
288288
Expect(err).To(BeNil())
@@ -295,7 +295,7 @@ var test02Push = func() {
295295
g.Specify("Delete manifest created in tests", func() {
296296
SkipIfDisabled(push)
297297
RunOnlyIf(runPushSetup)
298-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest))
298+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[1].Digest))
299299
resp, err := client.Do(req)
300300
Expect(err).To(BeNil())
301301
Expect(resp.StatusCode()).To(SatisfyAny(
@@ -311,7 +311,7 @@ var test02Push = func() {
311311
g.Specify("Delete config blob created in tests", func() {
312312
SkipIfDisabled(push)
313313
RunOnlyIf(runPushSetup)
314-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
314+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[1].Digest))
315315
resp, err := client.Do(req)
316316
Expect(err).To(BeNil())
317317
Expect(resp.StatusCode()).To(SatisfyAny(
@@ -342,7 +342,7 @@ var test02Push = func() {
342342
g.Specify("Delete manifest created in tests", func() {
343343
SkipIfDisabled(push)
344344
RunOnlyIf(runPushSetup)
345-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest))
345+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[1].Digest))
346346
resp, err := client.Do(req)
347347
Expect(err).To(BeNil())
348348
Expect(resp.StatusCode()).To(SatisfyAny(

conformance/03_discovery_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ var test03ContentDiscovery = func() {
2626
resp, err := client.Do(req)
2727
Expect(err).To(BeNil())
2828
req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()).
29-
SetQueryParam("digest", configBlobDigest).
29+
SetQueryParam("digest", configs[2].Digest).
3030
SetHeader("Content-Type", "application/octet-stream").
31-
SetHeader("Content-Length", fmt.Sprintf("%d", len(configBlobContent))).
32-
SetBody(configBlobContent)
31+
SetHeader("Content-Length", configs[2].ContentLength).
32+
SetBody(configs[2].Content)
3333
resp, err = client.Do(req)
3434
Expect(err).To(BeNil())
3535
Expect(resp.StatusCode()).To(SatisfyAll(
@@ -64,7 +64,7 @@ var test03ContentDiscovery = func() {
6464
req := client.NewRequest(reggie.PUT, "/v2/<name>/manifests/<reference>",
6565
reggie.WithReference(tag)).
6666
SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json").
67-
SetBody(manifestContent)
67+
SetBody(manifests[2].Content)
6868
resp, err := client.Do(req)
6969
Expect(err).To(BeNil())
7070
Expect(resp.StatusCode()).To(SatisfyAll(
@@ -132,7 +132,7 @@ var test03ContentDiscovery = func() {
132132
g.Specify("Delete created manifest & associated tags", func() {
133133
SkipIfDisabled(contentDiscovery)
134134
RunOnlyIf(runContentDiscoverySetup)
135-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest))
135+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[2].Digest))
136136
resp, err := client.Do(req)
137137
Expect(err).To(BeNil())
138138
Expect(resp.StatusCode()).To(SatisfyAny(
@@ -148,7 +148,7 @@ var test03ContentDiscovery = func() {
148148
g.Specify("Delete config blob created in tests", func() {
149149
SkipIfDisabled(contentDiscovery)
150150
RunOnlyIf(runContentDiscoverySetup)
151-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
151+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[2].Digest))
152152
resp, err := client.Do(req)
153153
Expect(err).To(BeNil())
154154
Expect(resp.StatusCode()).To(SatisfyAny(
@@ -179,7 +179,7 @@ var test03ContentDiscovery = func() {
179179
g.Specify("Delete created manifest & associated tags", func() {
180180
SkipIfDisabled(contentDiscovery)
181181
RunOnlyIf(runContentDiscoverySetup)
182-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest))
182+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[2].Digest))
183183
resp, err := client.Do(req)
184184
Expect(err).To(BeNil())
185185
Expect(resp.StatusCode()).To(SatisfyAny(

conformance/04_management_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ var test04ContentManagement = func() {
2424
resp, err := client.Do(req)
2525
Expect(err).To(BeNil())
2626
req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()).
27-
SetHeader("Content-Length", configBlobContentLength).
27+
SetHeader("Content-Length", configs[3].ContentLength).
2828
SetHeader("Content-Type", "application/octet-stream").
29-
SetQueryParam("digest", configBlobDigest).
30-
SetBody(configBlobContent)
29+
SetQueryParam("digest", configs[3].Digest).
30+
SetBody(configs[3].Content)
3131
resp, err = client.Do(req)
3232
Expect(err).To(BeNil())
3333
Expect(resp.StatusCode()).To(SatisfyAll(
@@ -60,7 +60,7 @@ var test04ContentManagement = func() {
6060
req := client.NewRequest(reggie.PUT, "/v2/<name>/manifests/<reference>",
6161
reggie.WithReference(tagToDelete)).
6262
SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json").
63-
SetBody(manifestContent)
63+
SetBody(manifests[3].Content)
6464
resp, err := client.Do(req)
6565
Expect(err).To(BeNil())
6666
Expect(resp.StatusCode()).To(SatisfyAll(
@@ -104,7 +104,7 @@ var test04ContentManagement = func() {
104104

105105
g.Specify("DELETE request to manifest (digest) should yield 202 response unless already deleted", func() {
106106
SkipIfDisabled(contentManagement)
107-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest))
107+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[3].Digest))
108108
resp, err := client.Do(req)
109109
Expect(err).To(BeNil())
110110
// In the case that the previous request was accepted, this may or may not fail (which is ok)
@@ -116,7 +116,7 @@ var test04ContentManagement = func() {
116116

117117
g.Specify("GET request to deleted manifest URL should yield 404 response, unless delete is disallowed", func() {
118118
SkipIfDisabled(contentManagement)
119-
req := client.NewRequest(reggie.GET, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifestDigest))
119+
req := client.NewRequest(reggie.GET, "/v2/<name>/manifests/<digest>", reggie.WithDigest(manifests[3].Digest))
120120
resp, err := client.Do(req)
121121
Expect(err).To(BeNil())
122122
Expect(resp.StatusCode()).To(SatisfyAny(
@@ -144,7 +144,7 @@ var test04ContentManagement = func() {
144144
SkipIfDisabled(contentManagement)
145145
RunOnlyIf(runContentManagementSetup)
146146
// config blob
147-
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
147+
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[3].Digest))
148148
resp, err := client.Do(req)
149149
Expect(err).To(BeNil())
150150
Expect(resp.StatusCode()).To(Equal(http.StatusAccepted))
@@ -159,7 +159,7 @@ var test04ContentManagement = func() {
159159
g.Specify("GET request to deleted blob URL should yield 404 response", func() {
160160
SkipIfDisabled(contentManagement)
161161
RunOnlyIf(runContentManagementSetup)
162-
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
162+
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[3].Digest))
163163
resp, err := client.Do(req)
164164
Expect(err).To(BeNil())
165165
Expect(resp.StatusCode()).To(Equal(http.StatusNotFound))

conformance/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ This will create a local `results/` directory containing all of the test report
203203
A GitHub Action is provided by this repo which you can use
204204
as part of a GitHub-based CI pipeline.
205205

206-
The following example will build the binary off of the master branch,
206+
The following example will build the binary off of the main branch,
207207
run the tests, and upload `junit.xml` and `report.html` as build artifacts:
208208

209209
```yaml
@@ -215,7 +215,7 @@ jobs:
215215
runs-on: ubuntu-latest
216216
steps:
217217
- name: Run OCI Distribution Spec conformance tests
218-
uses: opencontainers/distribution-spec@master
218+
uses: opencontainers/distribution-spec@main
219219
env:
220220
OCI_ROOT_URL: https://myreg.io
221221
OCI_NAMESPACE: mytestorg/mytestrepo

0 commit comments

Comments
 (0)