diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-01-14 13:58:03 +0100 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-01-15 17:08:16 +0100 |
commit | 63d8ba64e4fd1ed1bef910b313029ca6535f43cf (patch) | |
tree | 10cd42fb53e7960a4f129d72fd5da09ab6cc803f /pkg/adapter/containers.go | |
parent | e025b43060e7d9841dfdc7c9bfca93c7d99241b4 (diff) | |
download | podman-63d8ba64e4fd1ed1bef910b313029ca6535f43cf.tar.gz podman-63d8ba64e4fd1ed1bef910b313029ca6535f43cf.tar.bz2 podman-63d8ba64e4fd1ed1bef910b313029ca6535f43cf.zip |
v2 api: top improvements
* Use `pkg/adapter` to increase code reuse and reduce code redundancy.
* Extend swagger docs to mention AIX descriptors.
* Document the libpod endpoint which shares the same handler.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r-- | pkg/adapter/containers.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go index 8b21d6b94..df9f13944 100644 --- a/pkg/adapter/containers.go +++ b/pkg/adapter/containers.go @@ -927,9 +927,7 @@ func (r *LocalRuntime) Top(cli *cliconfig.TopValues) ([]string, error) { output, err = r.execPS(container, descriptors) if err != nil { - // Note: return psgoErr to guide users into using the AIX descriptors - // instead of using ps(1). - return nil, psgoErr + return nil, errors.Wrapf(err, "error executing ps(1) in the container") } // Trick: filter the ps command from the output instead of @@ -956,10 +954,8 @@ func (r *LocalRuntime) execPS(c *libpod.Container, args []string) ([]string, err streams := new(libpod.AttachStreams) streams.OutputStream = wPipe streams.ErrorStream = wPipe - streams.InputStream = bufio.NewReader(os.Stdin) streams.AttachOutput = true streams.AttachError = true - streams.AttachInput = true psOutput := []string{} go func() { |