mirror of
https://github.com/containers/podman.git
synced 2025-06-18 07:28:57 +08:00
allow filters to work when listing containers
enable filters when listing containers on the libpod endpoint. Fixes: #5841 Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
@ -32,10 +32,6 @@ func ContainerExists(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ListContainers(w http.ResponseWriter, r *http.Request) {
|
func ListContainers(w http.ResponseWriter, r *http.Request) {
|
||||||
var (
|
|
||||||
//filterFuncs []libpod.ContainerFilter
|
|
||||||
//pss []entities.ListContainer
|
|
||||||
)
|
|
||||||
decoder := r.Context().Value("decoder").(*schema.Decoder)
|
decoder := r.Context().Value("decoder").(*schema.Decoder)
|
||||||
query := struct {
|
query := struct {
|
||||||
All bool `schema:"all"`
|
All bool `schema:"all"`
|
||||||
@ -54,10 +50,10 @@ func ListContainers(w http.ResponseWriter, r *http.Request) {
|
|||||||
errors.Wrapf(err, "Failed to parse parameters for %s", r.URL.String()))
|
errors.Wrapf(err, "Failed to parse parameters for %s", r.URL.String()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime := r.Context().Value("runtime").(*libpod.Runtime)
|
runtime := r.Context().Value("runtime").(*libpod.Runtime)
|
||||||
opts := entities.ContainerListOptions{
|
opts := entities.ContainerListOptions{
|
||||||
All: query.All,
|
All: query.All,
|
||||||
|
Filters: query.Filters,
|
||||||
Last: query.Last,
|
Last: query.Last,
|
||||||
Size: query.Size,
|
Size: query.Size,
|
||||||
Sort: "",
|
Sort: "",
|
||||||
|
Reference in New Issue
Block a user