-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add GET /quadlets/{name} #27599
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
base: main
Are you sure you want to change the base?
Add GET /quadlets/{name} #27599
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: inknos The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
|
Out of curiousity, unrelated to this PR: Are you planning to do a refactor of the existing |
I am not planning on it, but let me understand better. what kind of refactor are you thinking of? |
|
I don't think the existing endpoint really needs work, unless you wanted to change it to better match the new endpoints you're writing. |
df5c1a9 to
52cfa74
Compare
| // Use QuadletPrint to get the raw file contents | ||
| quadletContents, err := containerEngine.QuadletPrint(r.Context(), name) | ||
| if err != nil { | ||
| utils.Error(w, http.StatusNotFound, fmt.Errorf("no such quadlet: %s: %w", name, err)) |
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.
is a 404 for any error returned by print correct? 404 should only mean doesn't exist but looking at the code I see an error like is not a supported quadlet file type which doesn't sounds like a 404 to me but rather a 400 for example.
I guess it doesn't matter to match and handing it out specific status codes means we would need to use typed error in quadlet and then match them here with errors.Is/As to differentiate. Maybe that that will get to complicated for no practical gain.
34bc79f to
d8ea89a
Compare
Fixes: https://issues.redhat.com/browse/RUN-3716 Signed-off-by: Nicola Sella <nsella@redhat.com>
d8ea89a to
ee0efb9
Compare
|
LGTM, restarted failed tests. |
Fixes: https://issues.redhat.com/browse/RUN-3716
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?