From 76afb50f3ae41a3cc43fca8cc41a2d2f1f1b6dcc Mon Sep 17 00:00:00 2001 From: Baron Lenardson Date: Tue, 22 Dec 2020 20:29:31 -0600 Subject: Consolidate filter logic to pkg subdirectory Per the conversation on pull/8724 I am consolidating filter logic and helper functions under the pkg/domain/filters dir. Signed-off-by: Baron Lenardson --- pkg/api/handlers/compat/containers_prune.go | 4 ++-- pkg/api/handlers/utils/pods.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/api') diff --git a/pkg/api/handlers/compat/containers_prune.go b/pkg/api/handlers/compat/containers_prune.go index 2cfeebcce..a1e35dd97 100644 --- a/pkg/api/handlers/compat/containers_prune.go +++ b/pkg/api/handlers/compat/containers_prune.go @@ -4,9 +4,9 @@ import ( "net/http" "github.com/containers/podman/v2/libpod" - lpfilters "github.com/containers/podman/v2/libpod/filters" "github.com/containers/podman/v2/pkg/api/handlers/utils" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/filters" "github.com/docker/docker/api/types" "github.com/gorilla/schema" "github.com/pkg/errors" @@ -29,7 +29,7 @@ func PruneContainers(w http.ResponseWriter, r *http.Request) { } filterFuncs := make([]libpod.ContainerFilter, 0, len(query.Filters)) for k, v := range query.Filters { - generatedFunc, err := lpfilters.GenerateContainerFilterFuncs(k, v, runtime) + generatedFunc, err := filters.GenerateContainerFilterFuncs(k, v, runtime) if err != nil { utils.InternalServerError(w, err) return diff --git a/pkg/api/handlers/utils/pods.go b/pkg/api/handlers/utils/pods.go index 7506dbfd1..0fe3a308b 100644 --- a/pkg/api/handlers/utils/pods.go +++ b/pkg/api/handlers/utils/pods.go @@ -4,8 +4,8 @@ import ( "net/http" "github.com/containers/podman/v2/libpod" - lpfilters "github.com/containers/podman/v2/libpod/filters" "github.com/containers/podman/v2/pkg/domain/entities" + dfilters "github.com/containers/podman/v2/pkg/domain/filters" "github.com/gorilla/schema" ) @@ -31,7 +31,7 @@ func GetPods(w http.ResponseWriter, r *http.Request) ([]*entities.ListPodsReport filters := make([]libpod.PodFilter, 0, len(query.Filters)) for k, v := range query.Filters { - f, err := lpfilters.GeneratePodFilterFunc(k, v) + f, err := dfilters.GeneratePodFilterFunc(k, v) if err != nil { return nil, err } -- cgit v1.2.3-54-g00ecf