Skip to content

ps doesn't output all services -> offset of 1 service #251

Open
@FredPi17

Description

@FredPi17

Hello everyone !

I'm having an issue with ps command. Find below the test code I execute to ps services of a stack of services:

const compose = require('docker-compose')

compose.ps({
    cwd: '~/personnal-repo/project/user_id/testkikou', log: false
  })
  .then((data) => {
    console.log(data)
    console.log(data.data)
  })
  .catch((err) => {
    console.log(err)
})

And here the output in my console:

{
  exitCode: 0,
  err: '',
  out: 'NAME                IMAGE                                 COMMAND                  SERVICE             CREATED             STATUS                          PORTS\n' +
    'jupyter-testkikou   jupyter/datascience-notebook:latest   "tini -g -- start-no…"   jupyter-testkikou   30 seconds ago      Up 29 seconds (healthy)         8888/tcp\n' +
    'nginx-testkikou     testkikou-nginx-testkikou             "/docker-entrypoint.…"   nginx-testkikou     About an hour ago   Restarting (1) 49 seconds ago   \n' +
    'vscode-testkikou    lscr.io/linuxserver/code-server       "/init"                  vscode-testkikou    32 minutes ago      Up 32 minutes                   8443/tcp\n',
  data: { services: [ [Object], [Object] ] }
}
{
  services: [
    {
      name: 'nginx-testkikou',
      command: 'testkikou-nginx-testkikou',
      state: '"/docker-entrypoint.…"',
      ports: [Array]
    },
    {
      name: 'vscode-testkikou',
      command: 'lscr.io/linuxserver/code-server',
      state: '"/init"',
      ports: [Array]
    }
  ]
} 

As you can see, in the first part of the log we see three services (those are running), and in the second part (second console.log) we see the services object returned by the package.
If I stop one service from the stack, it shows 1 service in the service object.

I don't know if the issue comes from me with my. bad usage or from a regression of the package. Your help is appreciated !

Thanks in advance 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions