summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod.go
diff options
context:
space:
mode:
authorSujil02 <sushah@redhat.com>2020-03-09 20:07:55 -0400
committerSujil02 <sushah@redhat.com>2020-03-17 17:46:20 -0400
commit15326f051d6938e5d3cdcec2f95f86ad3aa5c5fa (patch)
tree45efba0ddc6a4e5edf821f2d44e847b8d744abe2 /libpod/runtime_pod.go
parentf3a28de3249032e5d7be14114b126c7bddf3d479 (diff)
downloadpodman-15326f051d6938e5d3cdcec2f95f86ad3aa5c5fa.tar.gz
podman-15326f051d6938e5d3cdcec2f95f86ad3aa5c5fa.tar.bz2
podman-15326f051d6938e5d3cdcec2f95f86ad3aa5c5fa.zip
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 <sushah@redhat.com>
Diffstat (limited to 'libpod/runtime_pod.go')
-rw-r--r--libpod/runtime_pod.go10
1 files changed, 1 insertions, 9 deletions
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