api: implement compat distribution inspect endpoint#28358
api: implement compat distribution inspect endpoint#28358aaron-ang wants to merge 1 commit intocontainers:mainfrom
Conversation
df2ff09 to
12e4664
Compare
12e4664 to
8dd8fed
Compare
| func DistributionInspect(w http.ResponseWriter, r *http.Request) { | ||
| runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime) | ||
| imageName := utils.GetName(r) | ||
| if _, err := reference.ParseNormalizedNamed(imageName); err != nil { |
There was a problem hiding this comment.
I believe this check is redundant with the check on row 42.
| } | ||
|
|
||
| var latestErr error | ||
| appendErr := func(e error) { |
| // responses: | ||
| // 200: | ||
| // $ref: "#/responses/distributionInspectResponse" | ||
| // 401: |
There was a problem hiding this comment.
Docker's spec describes the 401 response as "Failed authentication or no image found.".
test/apiv2/10-images.at
Outdated
| t GET "/distribution/quay.io/idonotexist/idonotexist:dummy/json" 401 | ||
|
|
||
| # Exercise the single-manifest path using a digest from the multi-arch test image. | ||
| single_manifest_digest=sha256:6953980e46925f8ac2c09fc7ecf9f353c2cac49f87e7e60ed78287d55a14c296 |
There was a problem hiding this comment.
I am not sure about hardcoding the manifest digest.
| utils.InternalServerError(w, latestErr) | ||
| } | ||
|
|
||
| func distributionInspectFromManifest(ctx context.Context, src types.ImageSource, named reference.Named, manifestBytes []byte, manifestType string) (dockerRegistry.DistributionInspect, error) { |
There was a problem hiding this comment.
I think this function can be simplified with things from container-libs. Please check that repository; there are definitely things that can help simplify it.
|
thanks for the comments @Honny1, will review and implement the changes. |
da4dd25 to
d2d374f
Compare
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
3 similar comments
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
|
@mtrmac mind adding this to your list of things to review at your convience ? |
d2d374f to
56bd7e5
Compare
Signed-off-by: Aaron Ang <aaron.angyd@gmail.com>
56bd7e5 to
9454b2a
Compare
Fixes #17726.
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?