From 63d8ba64e4fd1ed1bef910b313029ca6535f43cf Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 14 Jan 2020 13:58:03 +0100 Subject: 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 --- pkg/adapter/containers.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'pkg/adapter') 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() { -- cgit v1.2.3-54-g00ecf