summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-06-25 17:34:04 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-26 09:46:29 +0000
commitb23371cb1db91e98bebdab86132e3d90a5cce5e4 (patch)
tree037abc4a522ad5fdf39dc11ace23695f4ca6c216 /cmd
parent208b9a6b6b250295759d3ef7d379b7b498144f4a (diff)
downloadpodman-b23371cb1db91e98bebdab86132e3d90a5cce5e4.tar.gz
podman-b23371cb1db91e98bebdab86132e3d90a5cce5e4.tar.bz2
podman-b23371cb1db91e98bebdab86132e3d90a5cce5e4.zip
Containers can dissappear
Between the time that ps command gets the list of containers and is able to ask for more data, the container could have exited. This patch logs Clibpod.ErrNoSuchCtr errors and just continues processing. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #996 Approved by: mheon
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/ps.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 18c75495c..a89523e83 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -16,6 +16,7 @@ import (
"github.com/projectatomic/libpod/cmd/podman/libpodruntime"
"github.com/projectatomic/libpod/libpod"
"github.com/projectatomic/libpod/pkg/util"
+ "github.com/sirupsen/logrus"
"github.com/urfave/cli"
"k8s.io/apimachinery/pkg/fields"
)
@@ -564,6 +565,10 @@ func getAndSortJSONParams(containers []*libpod.Container, opts batchcontainer.Ps
for _, ctr := range containers {
batchInfo, err := batchcontainer.BatchContainerOp(ctr, opts)
if err != nil {
+ if errors.Cause(err) == libpod.ErrNoSuchCtr {
+ logrus.Warn(err)
+ continue
+ }
return nil, err
}