Skip to content

Commit a12c8d7

Browse files
authored
Merge pull request #499 from sudo-bmitch/pr-blob-delete-405
Blob delete permits the 405 response code
2 parents 961602b + 3c7a4ac commit a12c8d7

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

conformance/04_management_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var test04ContentManagement = func() {
1515
const defaultTagName = "tagtest0"
1616
var tagToDelete string
1717
var numTags int
18+
var blobDeleteAllowed = true
1819

1920
g.Context("Setup", func() {
2021
g.Specify("Populate registry with test config blob", func() {
@@ -147,7 +148,11 @@ var test04ContentManagement = func() {
147148
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[3].Digest))
148149
resp, err := client.Do(req)
149150
Expect(err).To(BeNil())
150-
Expect(resp.StatusCode()).To(Equal(http.StatusAccepted))
151+
Expect(resp.StatusCode()).To(SatisfyAny(
152+
Equal(http.StatusAccepted),
153+
Equal(http.StatusNotFound),
154+
Equal(http.StatusMethodNotAllowed),
155+
))
151156
// layer blob
152157
req = client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(layerBlobDigest))
153158
resp, err = client.Do(req)
@@ -156,12 +161,17 @@ var test04ContentManagement = func() {
156161
Expect(resp.StatusCode()).To(SatisfyAny(
157162
Equal(http.StatusAccepted),
158163
Equal(http.StatusNotFound),
159-
))
164+
Equal(http.StatusMethodNotAllowed),
165+
))
166+
if resp.StatusCode() == http.StatusMethodNotAllowed {
167+
blobDeleteAllowed = false
168+
}
160169
})
161170

162171
g.Specify("GET request to deleted blob URL should yield 404 response", func() {
163172
SkipIfDisabled(contentManagement)
164173
RunOnlyIf(runContentManagementSetup)
174+
RunOnlyIf(blobDeleteAllowed)
165175
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[3].Digest))
166176
resp, err := client.Do(req)
167177
Expect(err).To(BeNil())

0 commit comments

Comments
 (0)