From b23371cb1db91e98bebdab86132e3d90a5cce5e4 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 25 Jun 2018 17:34:04 -0400 Subject: 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 Closes: #996 Approved by: mheon --- cmd/podman/ps.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd') 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 } -- cgit v1.2.3-54-g00ecf