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
This commit is contained in:
Daniel J Walsh
2018-06-25 17:34:04 -04:00
committed by Atomic Bot
parent 208b9a6b6b
commit b23371cb1d

View File

@ -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
}