summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-19 15:50:50 +0100
committerGitHub <noreply@github.com>2020-03-19 15:50:50 +0100
commit1be61789151c80d46c0c4b75a02fb23a6937df7b (patch)
treea3bb96491a3d2c2f2b76269e33af5c7919bdcc73 /libpod/runtime_pod.go
parente87fe4dbbbc55be42d7a31f5415f55d2ff99f81b (diff)
parent15326f051d6938e5d3cdcec2f95f86ad3aa5c5fa (diff)
downloadpodman-1be61789151c80d46c0c4b75a02fb23a6937df7b.tar.gz
podman-1be61789151c80d46c0c4b75a02fb23a6937df7b.tar.bz2
podman-1be61789151c80d46c0c4b75a02fb23a6937df7b.zip
Merge pull request #5445 from sujil02/podFilter-new
Filter pods through pod list api
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