-
Notifications
You must be signed in to change notification settings - Fork 209
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
Modify conformance tests for single-shot uploads #246
Conversation
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Should we change this to be optional if so many registries don't support it currently? |
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
@jzelinskie good call. just added a |
This is basically testing that the non-support does "the right thing". If they don't support it, then we would expect a 202 from the POST, and doing a blob GET should result in a 404. That will pass. If they do support it, then we would expect a 201 from the POST, and doing a blob GET should result in a 200. That will also pass. I believe any registry that doesn't support this would just not look at the request body (distribution behaves this way), and so they just return a 202 with the expectation that the client would follow up with a PATCH/PUT or just a PUT. If there is a registry that doesn't support this but also doesn't return a 202 in that case, the |
Does it really? |
I retract my comments about this breaking distribution. On further inspection, the same config blob is uploaded during pull test setup. If this is run with the following environment, things pass with docker/distribution (distribution/distribution):
So if anything, there is a bug in the tests which disallow running all 4 categories at once |
@jdolitsky is the same true for the other registries mentioned? If we can't find a legitimate breakage, we should just remove the skip and get this update in. |
@dmcgowan as far as I understand, Harbor (the other registry mentioned), uses distribution as backend. I can't imagine this will break them with that being the case. Also considering 230 was opened by one of the maintainers Will go ahead and remove the skip ability |
This reverts commit b9bf49b. Signed-off-by: Josh Dolitsky <josh@dolit.ski>
I think we need to fix #247 before we can merge this, right? |
@jonjohnsonjr probably best to do so - just opened #249 to address |
…to 201-202-debacle Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
After rebasing, here are the results running against docker/distribution (distribution/distribution): build conformance binary:
create config file with delete enabled:
start registry at localhost 5000:
set environment, all categories enabled:
run conformance tests:
results:
The 201 vs. 202 is now passing, but failing in other areas previously described here: distribution/distribution#3203 |
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
82f1643
to
ec32174
Compare
g.Specify("GET request to blob URL from prior request should yield 200 or 404 based on response code", func() { | ||
SkipIfDisabled(push) | ||
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[1].Digest)) | ||
resp, err := client.Do(req) | ||
Expect(err).To(BeNil()) | ||
Expect(resp.StatusCode()).To(Equal(http.StatusOK)) | ||
if lastResponse.StatusCode() == http.StatusAccepted { | ||
Expect(resp.StatusCode()).To(Equal(http.StatusNotFound)) | ||
} else { | ||
Expect(resp.StatusCode()).To(Equal(http.StatusOK)) | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the heart of the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is an attempt to implement this suggestion: #230 (comment)
Also updated Go module dependencies, Go version, golanglint-ci version, and removed some dead code