Git Product home page Git Product logo

Comments (6)

baude avatar baude commented on May 18, 2024

The problem is that the CMD may contain space delimited data. i.e. http -D This throws the splitting of that line of data off by index.

from podman.

baude avatar baude commented on May 18, 2024

@rhatdan @mheon @TomSweeneyRedHat I've been noodling on this for a while... I havent stumbled on a great way to fix this. Do you guys have any ideas?

Basically the issue is that we run a ps command inside the container and perform a strings.Field on the output which splits the string into a []string based on whitespace.

Ideally ps could identify a field delimiter but that doesn't seem to be an option. I messed with OFS and awk but I don't think it is reliable. Moving 'cmd' output to the end of the output table could be an option, but it surely doesn't output then in the order the user asked for. However, there are alias shortcuts in ps that include cmd so we could not always control it.

I also looked at the golang/psutil project and while good, it cannot support true ps options and would require a lot of wiring to make it work.

from podman.

mheon avatar mheon commented on May 18, 2024

@baude It would require some refactoring, but we could use the headers of the ps output to determine where the columns are in the output line and use that to split instead - get the index of the start of each word in the header, and then split at those indexes

from podman.

baude avatar baude commented on May 18, 2024

@mheon I looked into this a bit ... The problem I am seeing is that the column data line up is not reliable either. Consider the following:

01234567890123456789012345678901234567890
  UID   PID  PPID  C STIME TTY          TIME CMD
    0 13908 13898  0  2017 pts/0    00:01:44 top

Some line up to the header on the right, the left, and even in the middle!

from podman.

mheon avatar mheon commented on May 18, 2024

@baude Oh that's just lovely. And I take it we can't guarantee that CMD will always be the last entry, either?

from podman.

baude avatar baude commented on May 18, 2024

Nope ... think we might need to deep dive this a little deeper and see what others do

from podman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.