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

Blob delete permits the 405 response code #499

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions conformance/04_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var test04ContentManagement = func() {
const defaultTagName = "tagtest0"
var tagToDelete string
var numTags int
var blobDeleteAllowed = true

g.Context("Setup", func() {
g.Specify("Populate registry with test config blob", func() {
Expand Down Expand Up @@ -147,7 +148,11 @@ var test04ContentManagement = func() {
req := client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[3].Digest))
resp, err := client.Do(req)
Expect(err).To(BeNil())
Expect(resp.StatusCode()).To(Equal(http.StatusAccepted))
Expect(resp.StatusCode()).To(SatisfyAny(
Equal(http.StatusAccepted),
Equal(http.StatusNotFound),
Equal(http.StatusMethodNotAllowed),
))
// layer blob
req = client.NewRequest(reggie.DELETE, "/v2/<name>/blobs/<digest>", reggie.WithDigest(layerBlobDigest))
resp, err = client.Do(req)
Expand All @@ -156,12 +161,17 @@ var test04ContentManagement = func() {
Expect(resp.StatusCode()).To(SatisfyAny(
Equal(http.StatusAccepted),
Equal(http.StatusNotFound),
))
Equal(http.StatusMethodNotAllowed),
))
if resp.StatusCode() == http.StatusMethodNotAllowed {
blobDeleteAllowed = false
}
})

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