diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-10 12:59:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-10 12:59:06 -0400 |
commit | 68fd9aa2cf67a749258ccdc6fa8fd89c2557ebfc (patch) | |
tree | c3b6d5d3f767326407e80f54324acb45daa0fa45 /pkg/ps/ps.go | |
parent | 5ba21849a517659203a5879553f5dfb20963b7b5 (diff) | |
parent | 569854d6348e1cd74e8d654c88720e5517898f1a (diff) | |
download | podman-68fd9aa2cf67a749258ccdc6fa8fd89c2557ebfc.tar.gz podman-68fd9aa2cf67a749258ccdc6fa8fd89c2557ebfc.tar.bz2 podman-68fd9aa2cf67a749258ccdc6fa8fd89c2557ebfc.zip |
Merge pull request #7223 from mheon/fix_7214
Unconditionally retrieve pod names via API
Diffstat (limited to 'pkg/ps/ps.go')
-rw-r--r-- | pkg/ps/ps.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/ps/ps.go b/pkg/ps/ps.go index 8163d7247..4c5f60844 100644 --- a/pkg/ps/ps.go +++ b/pkg/ps/ps.go @@ -175,11 +175,14 @@ func ListContainerBatch(rt *libpod.Runtime, ctr *libpod.Container, opts entities State: conState.String(), } if opts.Pod && len(conConfig.Pod) > 0 { - pod, err := rt.GetPod(conConfig.Pod) + podName, err := rt.GetName(conConfig.Pod) if err != nil { + if errors.Cause(err) == define.ErrNoSuchCtr { + return entities.ListContainer{}, errors.Wrapf(define.ErrNoSuchPod, "could not find container %s pod (id %s) in state", conConfig.ID, conConfig.Pod) + } return entities.ListContainer{}, err } - ps.PodName = pod.Name() + ps.PodName = podName } if opts.Namespace { |