From 15326f051d6938e5d3cdcec2f95f86ad3aa5c5fa Mon Sep 17 00:00:00 2001 From: Sujil02 Date: Mon, 9 Mar 2020 20:07:55 -0400 Subject: Filter pods through pod list api Refactored current filter pods flow through the shared pod functions so filter pod functionalities can be shared between api and cmd. Signed-off-by: Sujil02 --- libpod/runtime_pod.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'libpod') diff --git a/libpod/runtime_pod.go b/libpod/runtime_pod.go index e1dc31391..be566e211 100644 --- a/libpod/runtime_pod.go +++ b/libpod/runtime_pod.go @@ -90,18 +90,10 @@ func (r *Runtime) LookupPod(idOrName string) (*Pod, error) { // output. Multiple filters are handled by ANDing their output, so only pods // matching all filters are returned func (r *Runtime) Pods(filters ...PodFilter) ([]*Pod, error) { - r.lock.RLock() - defer r.lock.RUnlock() - - if !r.valid { - return nil, define.ErrRuntimeStopped - } - - pods, err := r.state.AllPods() + pods, err := r.GetAllPods() if err != nil { return nil, err } - podsFiltered := make([]*Pod, 0, len(pods)) for _, pod := range pods { include := true -- cgit v1.2.3-54-g00ecf