-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Docker compat API - /images/search returns wrong structure (#7857) #8758
Conversation
LGTM
…On Wed, Dec 16, 2020 at 6:57 PM OpenShift CI Robot ***@***.***> wrote:
[APPROVALNOTIFIER] This PR is *NOT APPROVED*
This pull-request has been approved by: *mlegenovic
<#8758#>*
To complete the pull request process
<https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process>,
please assign *baude* after the PR has been reviewed.
You can assign the PR to them by writing /assign @baude in a comment when
ready.
The full list of commands accepted by this bot can be found here
<https://go.k8s.io/bot-commands?repo=containers%2Fpodman>.
Needs approval from an approver in each of these files:
- *OWNERS <https://github.com/containers/podman/blob/master/OWNERS>*
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8758 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCD2DWSLSULJUWTNXQLSVFCNLANCNFSM4U6YE3JQ>
.
|
@@ -77,5 +78,18 @@ func SearchImages(w http.ResponseWriter, r *http.Request) { | |||
utils.BadRequest(w, "term", query.Term, err) | |||
return | |||
} | |||
utils.WriteResponse(w, http.StatusOK, results) | |||
|
|||
compatResults := []registry.SearchResult{} |
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.
compatResults := []registry.SearchResult{} | |
compatResults := make([]registry.SearchResult,0,len(results)) |
You should preallocate memory for the slice to reduce the memory copy operations.
LGTM with @Luap99 change. |
Signed-off-by: Milivoje Legenovic <[email protected]>
@containers/podman-maintainers PTAL |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mlegenovic, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
Signed-off-by: Milivoje Legenovic [email protected]