Fix GetProcesses in docker
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
1d1a225be6
commit
81b3d45a4b
1 changed files with 3 additions and 2 deletions
|
@ -459,14 +459,15 @@ func (d *Driver) GetProcesses(name string) ([]string, error) {
|
|||
}
|
||||
defer cli.Close()
|
||||
|
||||
processList, err := cli.ContainerTop(ctx, name, []string{"-eo", "args"})
|
||||
processList, err := cli.ContainerTop(ctx, name, []string{"-eo", "pid,args"})
|
||||
if err != nil {
|
||||
return processes, fmt.Errorf("docker container top call error: %v", err)
|
||||
}
|
||||
|
||||
for _, process := range processList.Processes {
|
||||
if len(process) > 0 {
|
||||
processes = append(processes, process[0])
|
||||
// This removes PID from the list. PID has to be printed otherwise docker daemon can't handle it.
|
||||
processes = append(processes, strings.Join(strings.Fields(process[0])[1:], " "))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue