diff options
author | Sujil02 <sushah@redhat.com> | 2020-03-09 20:07:55 -0400 |
---|---|---|
committer | Sujil02 <sushah@redhat.com> | 2020-03-17 17:46:20 -0400 |
commit | 15326f051d6938e5d3cdcec2f95f86ad3aa5c5fa (patch) | |
tree | 45efba0ddc6a4e5edf821f2d44e847b8d744abe2 /libpod/runtime_pod.go | |
parent | f3a28de3249032e5d7be14114b126c7bddf3d479 (diff) | |
download | podman-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.go | 10 |
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 |